コード例 #1
0
ファイル: EditableTitle.xaml.cs プロジェクト: e-/FlexTable
        public EditableTitle()
        {
            this.InitializeComponent();

            drawable.Attach(Root, StrokeGrid, NewStrokeGrid);
            drawable.StrokeAdded += Drawable_StrokeAdded;
        }
コード例 #2
0
ファイル: TableView.xaml.cs プロジェクト: e-/FlexTable
        public TableView()
        {
            this.InitializeComponent();

            drawable.Attach(SheetView, StrokeGrid, NewStrokeGrid);
            drawable.StrokeAdding += StrokeAdding;
            drawable.StrokeAdded  += StrokeAdded;
            timer.Tick            += timer_Tick;
        }
コード例 #3
0
        public GroupedBarChart()
        {
            this.InitializeComponent();

            HandleRectangleElement.Data         = D3Data;
            HandleRectangleElement.WidthGetter  = WidthGetter;        // HandleWidthGetter;
            HandleRectangleElement.HeightGetter = HandleHeightGetter; // HandleHeightGetter;
            HandleRectangleElement.XGetter      = XGetter;            // HandleXGetter;
            HandleRectangleElement.YGetter      = HandleYGetter;      // HandleYGetter; // d3.Util.CreateConstantGetter<Double>(Const.PaddingTop);
            HandleRectangleElement.ColorGetter  = d3.Util.CreateConstantGetter <Color>(Colors.Transparent);

            EnvelopeRectangleElement.Data          = D3Data;
            EnvelopeRectangleElement.WidthGetter   = WidthGetter;
            EnvelopeRectangleElement.HeightGetter  = EnvelopeHeightGetter;
            EnvelopeRectangleElement.XGetter       = XGetter;
            EnvelopeRectangleElement.YGetter       = EnvelopeYGetter;
            EnvelopeRectangleElement.ColorGetter   = ColorGetter;
            EnvelopeRectangleElement.OpacityGetter = EnvelopeOpacityGetter;

            RectangleElement.Data          = D3Data;
            RectangleElement.WidthGetter   = HighlightedWidthGetter;
            RectangleElement.HeightGetter  = HeightGetter;
            RectangleElement.XGetter       = HighlightedXGetter;
            RectangleElement.YGetter       = YGetter;
            RectangleElement.ColorGetter   = ColorGetter;
            RectangleElement.OpacityGetter = OpacityGetter;

            HorizontalAxis.Scale = XScale;
            Canvas.SetTop(HorizontalAxis, ChartAreaEndY);
            HorizontalAxis.Visibility = HorizontalAxisVisibility;
            //HorizontalAxis.LabelFontSizeGetter = LabelFontSizeGetter;
            HorizontalAxis.LabelOpacityGetter = HorizontalAxisLabelOpacityGetter;
            HorizontalAxis.LabelYGetter       = HorizontalAxisLabelYGetter;

            Canvas.SetTop(HorizontalAxisTitleElement, HorizontalAxisLabelCanvasTop);
            Canvas.SetLeft(HorizontalAxisTitleElement, HorizontalAxisLabelCanvasLeft);
            HorizontalAxisTitleElement.Width      = HorizontalAxisLabelWidth;
            HorizontalAxisTitleElement.Visibility = HorizontalAxisVisibility;
            HorizontalAxisTitleElement.Text       = HorizontalAxisTitle;

            VerticalAxis.Scale = YScale;
            Canvas.SetLeft(VerticalAxis, VerticalAxisCanvasLeft);
            Canvas.SetTop(VerticalAxisTitleElement, VerticalAxisLabelCanvasTop);
            Canvas.SetLeft(VerticalAxisTitleElement, VerticalAxisLabelCanvasLeft);
            VerticalAxisTitleElement.Width = VerticalAxisLabelHeight;
            VerticalAxisTitleElement.Text  = VerticalAxisTitle;

            LegendHandleRectangleElement.Data         = D3Data;
            LegendHandleRectangleElement.WidthGetter  = LegendHandleWidthGetter;
            LegendHandleRectangleElement.HeightGetter = d3.Util.CreateConstantGetter <Double>(Const.LegendPatchHeight + Const.LegendPatchSpace);
            LegendHandleRectangleElement.XGetter      = d3.Util.CreateConstantGetter <Double>(0);
            LegendHandleRectangleElement.YGetter      = LegendHandleYGetter;
            LegendHandleRectangleElement.ColorGetter  = d3.Util.CreateConstantGetter <Color>(Colors.Transparent);
            LegendHandleRectangleElement.Visibility   = LegendVisibility;

            LegendRectangleElement.Data          = D3Data;
            LegendRectangleElement.WidthGetter   = d3.Util.CreateConstantGetter <Double>(Const.LegendPatchWidth);
            LegendRectangleElement.HeightGetter  = d3.Util.CreateConstantGetter <Double>(Const.LegendPatchHeight);
            LegendRectangleElement.XGetter       = d3.Util.CreateConstantGetter <Double>(0);
            LegendRectangleElement.YGetter       = LegendPatchYGetter;
            LegendRectangleElement.ColorGetter   = ColorGetter;
            LegendRectangleElement.OpacityGetter = LegendPatchOpacityGetter;
            LegendRectangleElement.Visibility    = LegendVisibility;

            LegendTextElement.Data          = D3Data;
            LegendTextElement.TextGetter    = LegendTextGetter;
            LegendTextElement.HeightGetter  = d3.Util.CreateConstantGetter <Double>(Const.LegendPatchHeight);
            LegendTextElement.XGetter       = LegendTextXGetter;
            LegendTextElement.YGetter       = LegendPatchYGetter;
            LegendTextElement.ColorGetter   = d3.Util.CreateConstantGetter <Color>(Colors.Black);
            LegendTextElement.OpacityGetter = LegendTextOpacityGetter;
            LegendTextElement.Visibility    = LegendVisibility;

            IndicatorTextElement.Data          = D3Data;
            IndicatorTextElement.TextGetter    = IndicatorTextGetter;
            IndicatorTextElement.WidthGetter   = IndicatorWidthGetter;
            IndicatorTextElement.XGetter       = IndicatorXGetter;
            IndicatorTextElement.YGetter       = IndicatorYGetter;
            IndicatorTextElement.OpacityGetter = IndicatorTextOpacityGetter;

            HandleRectangleElement.RectangleTapped       += HandleRectangleElement_RectangleTapped;
            LegendHandleRectangleElement.RectangleTapped += LegendHandleRectangleElement_RectangleTapped;
            //HandleRectangleElement.RectangleManipulationDelta += HandleRectangleElement_RectangleManipulationDelta;
            //HandleRectangleElement.RectangleManipulationCompleted += HandleRectangleElement_RectangleManipulationCompleted;

            drawable.Attach(RootCanvas, StrokeGrid, NewStrokeGrid);
            drawable.StrokeAdded += Drawable_StrokeAdded;
        }
コード例 #4
0
        public LineChart()
        {
            this.InitializeComponent();

            HandleLineElement.Data                  = D3Data;
            HandleLineElement.CoordinateGetter      = LineCoordinateGetter;
            HandleLineElement.StrokeThicknessGetter = d3.Util.CreateConstantGetter <Double>(20);
            HandleLineElement.StrokeGetter          = d3.Util.CreateConstantGetter <Color>(Colors.Transparent);
            HandleLineElement.OpacityGetter         = d3.Util.CreateConstantGetter <Double>(1);

            EnvelopeLineElement.Data                  = D3Data;
            EnvelopeLineElement.CoordinateGetter      = EnvelopeLineCoordinateGetter;
            EnvelopeLineElement.StrokeThicknessGetter = d3.Util.CreateConstantGetter <Double>(5);
            EnvelopeLineElement.StrokeGetter          = LineStrokeGetter;
            EnvelopeLineElement.OpacityGetter         = d3.Util.CreateConstantGetter <Double>(0.1);

            EnvelopeCircleElement.Data          = D3Data;
            EnvelopeCircleElement.XGetter       = CircleXGetter;
            EnvelopeCircleElement.YGetter       = EnvelopeCircleYGetter;
            EnvelopeCircleElement.RadiusGetter  = d3.Util.CreateConstantGetter <Double>(10);
            EnvelopeCircleElement.ColorGetter   = CircleColorGetter;
            EnvelopeCircleElement.OpacityGetter = d3.Util.CreateConstantGetter <Double>(0.1); // EvenlopeCircleOpacityGetter;

            LineElement.Data                  = D3Data;
            LineElement.CoordinateGetter      = LineCoordinateGetter;
            LineElement.StrokeThicknessGetter = d3.Util.CreateConstantGetter <Double>(5);
            LineElement.StrokeGetter          = LineStrokeGetter;
            LineElement.OpacityGetter         = LineOpacityGetter;

            CircleElement.Data          = D3Data;
            CircleElement.XGetter       = CircleXGetter;
            CircleElement.YGetter       = CircleYGetter;
            CircleElement.RadiusGetter  = d3.Util.CreateConstantGetter <Double>(10);
            CircleElement.ColorGetter   = CircleColorGetter;
            CircleElement.OpacityGetter = CircleOpacityGetter;

            HorizontalAxis.Scale = XScale;
            Canvas.SetTop(HorizontalAxis, ChartAreaEndY);
            HorizontalAxis.Visibility = HorizontalAxisVisibility;

            Canvas.SetTop(HorizontalAxisTitleElement, HorizontalAxisLabelCanvasTop);
            Canvas.SetLeft(HorizontalAxisTitleElement, HorizontalAxisLabelCanvasLeft);
            HorizontalAxisTitleElement.Width      = HorizontalAxisLabelWidth;
            HorizontalAxisTitleElement.Visibility = HorizontalAxisVisibility;
            HorizontalAxisTitleElement.Text       = HorizontalAxisTitle;

            VerticalAxis.Scale = YScale;
            Canvas.SetLeft(VerticalAxis, VerticalAxisCanvasLeft);
            Canvas.SetTop(VerticalAxisTitleElement, VerticalAxisLabelCanvasTop);
            Canvas.SetLeft(VerticalAxisTitleElement, VerticalAxisLabelCanvasLeft);
            VerticalAxisTitleElement.Width = VerticalAxisLabelHeight;
            VerticalAxisTitleElement.Text  = VerticalAxisTitle;

            LegendHandleRectangleElement.Data         = D3Data;
            LegendHandleRectangleElement.WidthGetter  = LegendHandleWidthGetter;
            LegendHandleRectangleElement.HeightGetter = d3.Util.CreateConstantGetter <Double>(Const.LegendPatchHeight + Const.LegendPatchSpace);
            LegendHandleRectangleElement.XGetter      = d3.Util.CreateConstantGetter <Double>(0);
            LegendHandleRectangleElement.YGetter      = LegendHandleYGetter;
            LegendHandleRectangleElement.ColorGetter  = d3.Util.CreateConstantGetter <Color>(Colors.Transparent);
            LegendHandleRectangleElement.Visibility   = LegendVisibility;

            LegendRectangleElement.Data          = D3Data;
            LegendRectangleElement.WidthGetter   = d3.Util.CreateConstantGetter <Double>(Const.LegendPatchWidth);
            LegendRectangleElement.HeightGetter  = d3.Util.CreateConstantGetter <Double>(Const.LegendPatchHeight);
            LegendRectangleElement.XGetter       = d3.Util.CreateConstantGetter <Double>(0);
            LegendRectangleElement.YGetter       = LegendPatchYGetter;
            LegendRectangleElement.ColorGetter   = ColorGetter;
            LegendRectangleElement.OpacityGetter = LegendOpacityGetter;
            LegendRectangleElement.Visibility    = LegendVisibility;

            LegendTextElement.Data          = D3Data;
            LegendTextElement.TextGetter    = LegendTextGetter;
            LegendTextElement.HeightGetter  = d3.Util.CreateConstantGetter <Double>(Const.LegendPatchHeight);
            LegendTextElement.XGetter       = LegendTextXGetter;
            LegendTextElement.YGetter       = LegendPatchYGetter;
            LegendTextElement.ColorGetter   = d3.Util.CreateConstantGetter <Color>(Colors.Black);
            LegendTextElement.OpacityGetter = LegendTextOpacityGetter;
            LegendTextElement.Visibility    = LegendVisibility;

            IndicatorTextElement.Data          = D3Data;
            IndicatorTextElement.TextGetter    = IndicatorTextGetter;
            IndicatorTextElement.WidthGetter   = IndicatorWidthGetter;
            IndicatorTextElement.XGetter       = IndicatorXGetter;
            IndicatorTextElement.YGetter       = IndicatorYGetter;
            IndicatorTextElement.OpacityGetter = IndicatorTextOpacityGetter;

            HandleLineElement.LineTapped += LegendHandleRectangleElement_RectangleTapped;

            LegendHandleRectangleElement.RectangleTapped += LegendHandleRectangleElement_RectangleTapped;

            drawable.Attach(RootCanvas, StrokeGrid, NewStrokeGrid);
            drawable.StrokeAdded += Drawable_StrokeAdded;
        }
コード例 #5
0
ファイル: Scatterplot.xaml.cs プロジェクト: e-/FlexTable
        public Scatterplot()
        {
            this.InitializeComponent();

            CircleElement.Data          = D3Data;
            CircleElement.RadiusGetter  = d3.Util.CreateConstantGetter <Double>(5);
            CircleElement.XGetter       = XGetter;
            CircleElement.YGetter       = YGetter;
            CircleElement.ColorGetter   = ColorGetter;
            CircleElement.OpacityGetter = OpacityGetter;

            HorizontalAxis.Scale = XScale;
            Canvas.SetTop(HorizontalAxis, ChartAreaEndY);
            HorizontalAxis.Visibility = HorizontalAxisVisibility;
            //HorizontalAxis.LabelFontSizeGetter = LabelFontSizeGetter;
            //HorizontalAxis.LabelOpacityGetter = HorizontalAxisLabelOpacityGetter;
            //HorizontalAxis.LabelYGetter = HorizontalAxisLabelYGetter;

            Canvas.SetTop(HorizontalAxisTitleElement, HorizontalAxisLabelCanvasTop);
            Canvas.SetLeft(HorizontalAxisTitleElement, HorizontalAxisLabelCanvasLeft);
            HorizontalAxisTitleElement.Width      = HorizontalAxisLabelWidth;
            HorizontalAxisTitleElement.Visibility = HorizontalAxisVisibility;
            HorizontalAxisTitleElement.Text       = HorizontalAxisTitle;

            VerticalAxis.Scale = YScale;
            Canvas.SetLeft(VerticalAxis, VerticalAxisCanvasLeft);
            Canvas.SetTop(VerticalAxisTitleElement, VerticalAxisLabelCanvasTop);
            Canvas.SetLeft(VerticalAxisTitleElement, VerticalAxisLabelCanvasLeft);
            VerticalAxisTitleElement.Width = VerticalAxisLabelHeight;
            VerticalAxisTitleElement.Text  = VerticalAxisTitle;

            LegendHandleRectangleElement.Data         = D3Data;
            LegendHandleRectangleElement.WidthGetter  = LegendHandleWidthGetter;
            LegendHandleRectangleElement.HeightGetter = d3.Util.CreateConstantGetter <Double>(Const.LegendPatchHeight + Const.LegendPatchSpace);
            LegendHandleRectangleElement.XGetter      = d3.Util.CreateConstantGetter <Double>(0);
            LegendHandleRectangleElement.YGetter      = LegendHandleYGetter;
            LegendHandleRectangleElement.ColorGetter  = d3.Util.CreateConstantGetter <Color>(Colors.Transparent);
            LegendHandleRectangleElement.Visibility   = LegendVisibility;

            LegendRectangleElement.Data          = D3Data;
            LegendRectangleElement.WidthGetter   = d3.Util.CreateConstantGetter <Double>(Const.LegendPatchWidth);
            LegendRectangleElement.HeightGetter  = d3.Util.CreateConstantGetter <Double>(Const.LegendPatchHeight);
            LegendRectangleElement.XGetter       = d3.Util.CreateConstantGetter <Double>(0);
            LegendRectangleElement.YGetter       = LegendPatchYGetter;
            LegendRectangleElement.ColorGetter   = LegendColorGetter;
            LegendRectangleElement.OpacityGetter = LegendPatchOpacityGetter;
            LegendRectangleElement.Visibility    = LegendVisibility;

            LegendTextElement.Data          = D3Data;
            LegendTextElement.TextGetter    = LegendTextGetter;
            LegendTextElement.HeightGetter  = d3.Util.CreateConstantGetter <Double>(Const.LegendPatchHeight);
            LegendTextElement.XGetter       = LegendTextXGetter;
            LegendTextElement.YGetter       = LegendPatchYGetter;
            LegendTextElement.ColorGetter   = d3.Util.CreateConstantGetter <Color>(Colors.Black);
            LegendTextElement.OpacityGetter = LegendTextOpacityGetter;
            LegendTextElement.Visibility    = LegendVisibility;

            drawable.Attach(RootCanvas, StrokeGrid, NewStrokeGrid);
            drawable.StrokeAdded += Drawable_StrokeAdded;

            LegendHandleRectangleElement.RectangleTapped += LegendHandleRectangleElement_RectangleTapped;
        }