Ejemplo n.º 1
0
        //Main code for creating chart.
        //Note: the argument chartIndex is unused because this demo only has 1 chart.
        public void createChart(WPFChartViewer viewer, int chartIndex)
        {
            // Coordinates of the starting points of the vectors
            double[] radius = { 5,   5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5, 10, 10, 10, 10, 10, 10, 10, 10,
                                10, 10, 10, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 20, 20, 20, 20, 20,
                                20, 20, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25 };
            double[] angle = { 0,    30,  60,  90, 120, 150, 180, 210, 240, 270, 300, 330,   0,  30,  60,  90,
                               120, 150, 180, 210, 240, 270, 300, 330,   0,  30,  60,  90, 120, 150, 180, 210,240, 270,
                               300, 330,   0,  30,  60,  90, 120, 150, 180, 210, 240, 270, 300, 330,   0,  30, 60,  90,120,
                               150, 180, 210, 240, 270, 300, 330 };

            // Magnitude and direction of the vectors
            double[] magnitude = { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
                                   4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1,
                                   1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
            double[] direction = { 60,   90, 120, 150, 180, 210, 240, 270, 300, 330,   0,  30,  60,  90,
                                   120, 150, 180, 210, 240, 270, 300, 330,   0,  30,  60,  90, 120, 150,180, 210, 240, 270,
                                   300, 330,   0,  30,  60,  90, 120, 150, 180, 210, 240, 270, 300, 330, 0,  30,  60,  90,120,
                                   150, 180, 210, 240, 270, 300, 330,   0, 30 };

            // Create a PolarChart object of size 460 x 460 pixels
            PolarChart c = new PolarChart(460, 460);

            // Add a title to the chart at the top left corner using 15pt Arial Bold Italic font
            c.addTitle("Polar Vector Chart Demonstration", "Arial Bold Italic", 15);

            // Set center of plot area at (230, 240) with radius 180 pixels
            c.setPlotArea(230, 240, 180);

            // Set the grid style to circular grid
            c.setGridStyle(false);

            // Set angular axis as 0 - 360, with a spoke every 30 units
            c.angularAxis().setLinearScale(0, 360, 30);

            // Add a polar vector layer to the chart with blue (0000ff) vectors
            c.addVectorLayer(radius, angle, magnitude, direction, Chart.RadialAxisScale, 0x0000ff);

            // Output the chart
            viewer.Chart = c;

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='Vector at ({value}, {angle} deg): Length = {len}, Angle = {dir} deg'");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="View"/> class.
        /// </summary>
        public View()
        {
            InitializeComponent();
            Size = new System.Drawing.Size(50, 50);

            var viewModel = new ViewModel();

            var polarChart = new PolarChart
            {
                Series = viewModel.Series,

                // out of livecharts properties...
                Location = new System.Drawing.Point(0, 0),
                Size     = new System.Drawing.Size(50, 50),
                Anchor   = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom
            };

            Controls.Add(polarChart);
        }
Ejemplo n.º 3
0
        public void CreateChart(WinChartViewer viewer, GameCategoriesModel vModel)
        {
            // The data for the chart
            double[] data =
            {
                vModel.Card,
                vModel.Arcade,
                vModel.Matching,
                vModel.Action,
                vModel.Strategy,
                vModel.Word,
                vModel.Puzzles,
                vModel.Crossword,
                vModel.MeTVGames,
                vModel.Quizzes,
                vModel.Casino,
                vModel.BrainGames,
                vModel.Puzzle,
                vModel.Solitaire
            };

            // The labels for the chart
            string[] labels = { "Card", "Arcade", "Matching", "Action", "Strategy", "Word", "Puzzles", "Crossword", "MeTVGames", "Quizzes", "Casino", "BrainGames", "Puzzle", "Solitaire" };

            // Create a PolarChart object of size 450 x 350 pixels
            PolarChart c = new PolarChart(347, 238);

            // Set center of plot area at (225, 185) with radius 150 pixels
            c.setPlotArea(173, 115, 80);

            // Add an area layer to the polar chart
            c.addAreaLayer(data, 0x9999ff);

            // Set the labels to the angular axis as spokes
            c.angularAxis().setLabels(labels);

            // Output the chart
            viewer.Chart = c;

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "", "title='{label}: score = {value}'");
        }
Ejemplo n.º 4
0
        //Main code for creating chart.
        //Note: the argument img is unused because this demo only has 1 chart.
        public void createChart(WinChartViewer viewer, string img)
        {
            // Data for the chart
            double[] data = { 9.4, 1.8, 2.1, 2.3, 3.5, 7.7, 8.8, 6.1, 5.0, 3.1, 6.0,
                              4.3, 5.1, 2.6, 1.5, 2.2, 5.1, 4.3, 4.0, 9.0, 1.7, 8.8, 9.9, 9.5 };
            double[] angles = { 0,    15,  30,  45,  60,  75,  90, 105, 120, 135, 150, 165,
                                180, 195, 210, 225, 240, 255, 270, 285, 300, 315, 330, 345 };

            // Create a PolarChart object of size 460 x 460 pixels, with a silver
            // background and a 1 pixel 3D border
            PolarChart c = new PolarChart(460, 460, Chart.silverColor(), 0x000000, 1)
            ;

            // Add a title to the chart at the top left corner using 15pts Arial Bold
            // Italic font. Use white text on deep blue background.
            c.addTitle("Polar Vector Chart Demonstration", "Arial Bold Italic", 15,
                       0xffffff).setBackground(0x000080);

            // Set plot area center at (230, 240) with radius 180 pixels and white
            // background
            c.setPlotArea(230, 240, 180, 0xffffff);

            // Set the grid style to circular grid
            c.setGridStyle(false);

            // Set angular axis as 0 - 360, with a spoke every 30 units
            c.angularAxis().setLinearScale(0, 360, 30);

            // Add sectors to the chart as sector zones
            for (int i = 0; i < data.Length; ++i)
            {
                c.angularAxis().addZone(angles[i], angles[i] + 15, 0, data[i],
                                        0x33ff33, 0x008000);
            }

            // Add an Transparent invisible layer to ensure the axis is auto-scaled
            // using the data
            c.addLineLayer(data, Chart.Transparent);

            // Output the chart
            viewer.Image = c.makeImage();
        }
Ejemplo n.º 5
0
    /// <summary>
    /// Initializes a new instance of the <see cref="SKPolarChart"/> class.
    /// </summary>
    public SKPolarChart()
    {
        if (!LiveCharts.IsConfigured)
        {
            LiveCharts.Configure(LiveChartsSkiaSharp.DefaultPlatformBuilder);
        }

        var stylesBuilder = LiveCharts.CurrentSettings.GetTheme <SkiaSharpDrawingContext>();
        var initializer   = stylesBuilder.GetVisualsInitializer();

        if (stylesBuilder.CurrentColors is null || stylesBuilder.CurrentColors.Length == 0)
        {
            throw new Exception("Default colors are not valid");
        }
        initializer.ApplyStyleToChart(this);

        Core                 = new PolarChart <SkiaSharpDrawingContext>(this, LiveChartsSkiaSharp.DefaultPlatformBuilder, CoreCanvas);
        Core.Measuring      += OnCoreMeasuring;
        Core.UpdateStarted  += OnCoreUpdateStarted;
        Core.UpdateFinished += OnCoreUpdateFinished;
    }
Ejemplo n.º 6
0
        //
        // Create chart
        //
        private void createChart(RazorChartViewer viewer)
        {
            // The data for the chart
            double[] data0   = { 90, 25, 40, 55, 68, 44, 79, 85, 50 };
            double[] angles0 = { 15, 60, 110, 180, 230, 260, 260, 310, 340 };

            double[] data1   = { 80, 91, 66, 80, 92, 87 };
            double[] angles1 = { 40, 65, 88, 110, 150, 200 };

            // Create a PolarChart object of size 460 x 500 pixels, with a grey (e0e0e0) background and 1
            // pixel 3D border
            PolarChart c = new PolarChart(460, 500, 0xe0e0e0, 0x000000, 1);

            // Add a title to the chart at the top left corner using 15pt Arial Bold Italic font. Use a
            // wood pattern as the title background.
            c.addTitle("Polar Line Chart Demo", "Arial Bold Italic", 15).setBackground(c.patternColor(
                                                                                           Url.Content("~/Content/wood.png")));

            // Set center of plot area at (230, 280) with radius 180 pixels, and white (ffffff)
            // background.
            c.setPlotArea(230, 280, 180, 0xffffff);

            // Set the grid style to circular grid, with grids below the chart layers
            c.setGridStyle(false, false);

            // Add a legend box at top-center of plot area (230, 35) using horizontal layout. Use 10pt
            // Arial Bold font, with 1 pixel 3D border effect.
            LegendBox b = c.addLegend(230, 35, false, "Arial Bold", 9);

            b.setAlignment(Chart.TopCenter);
            b.setBackground(Chart.Transparent, Chart.Transparent, 1);

            // Set angular axis as 0 - 360, with a spoke every 30 units
            c.angularAxis().setLinearScale(0, 360, 30);

            // Add a blue (0xff) line layer to the chart using (data0, angle0)
            PolarLineLayer layer0 = c.addLineLayer(data0, 0x0000ff, "Close Loop Line");

            layer0.setAngles(angles0);

            // Set the line width to 2 pixels
            layer0.setLineWidth(2);

            // Use 11 pixel triangle symbols for the data points
            layer0.setDataSymbol(Chart.TriangleSymbol, 11);

            // Enable data label and set its format
            layer0.setDataLabelFormat("({value},{angle})");

            // Set the data label text box with light blue (0x9999ff) backgruond color and 1 pixel 3D
            // border effect
            layer0.setDataLabelStyle().setBackground(0x9999ff, Chart.Transparent, 1);

            // Add a red (0xff0000) line layer to the chart using (data1, angle1)
            PolarLineLayer layer1 = c.addLineLayer(data1, 0xff0000, "Open Loop Line");

            layer1.setAngles(angles1);

            // Set the line width to 2 pixels
            layer1.setLineWidth(2);

            // Use 11 pixel diamond symbols for the data points
            layer1.setDataSymbol(Chart.DiamondSymbol, 11);

            // Set the line to open loop
            layer1.setCloseLoop(false);

            // Enable data label and set its format
            layer1.setDataLabelFormat("({value},{angle})");

            // Set the data label text box with light red (0xff9999) backgruond color and 1 pixel 3D
            // border effect
            layer1.setDataLabelStyle().setBackground(0xff9999, Chart.Transparent, 1);

            // Output the chart
            viewer.Image = c.makeWebImage(Chart.PNG);

            // Include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("", "", "title='[{dataSetName}] ({radius}, {angle})'");
        }
Ejemplo n.º 7
0
        //Main code for creating chart.
        //Note: the argument chartIndex is unused because this demo only has 1 chart.
        public void createChart(WinChartViewer viewer, int chartIndex)
        {
            // The data for the chart
            double[] data0   = { 6, 12.5, 18.2, 15 };
            double[] angles0 = { 45, 96, 169, 258 };
            double[] size0   = { 41, 105, 12, 20 };

            double[] data1   = { 18, 16, 11, 14 };
            double[] angles1 = { 30, 210, 240, 310 };
            double[] size1   = { 30, 45, 12, 90 };

            // Create a PolarChart object of size 460 x 460 pixels
            PolarChart c = new PolarChart(460, 460);

            // Add a title to the chart at the top left corner using 15pt Arial Bold Italic font
            c.addTitle2(Chart.TopLeft, "<*underline=2*>EM Field Strength", "Arial Bold Italic", 15);

            // Set center of plot area at (230, 240) with radius 180 pixels
            c.setPlotArea(230, 240, 180);

            // Use alternative light grey/dark grey circular background color
            c.setPlotAreaBg(0xdddddd, 0xeeeeee);

            // Set the grid style to circular grid
            c.setGridStyle(false);

            // Add a legend box at the top right corner of the chart using 9pt Arial Bold font
            c.addLegend(459, 0, true, "Arial Bold", 9).setAlignment(Chart.TopRight);

            // Set angular axis as 0 - 360, with a spoke every 30 units
            c.angularAxis().setLinearScale(0, 360, 30);

            // Set the radial axis label format
            c.radialAxis().setLabelFormat("{value} km");

            // Add a blue (0x9999ff) line layer to the chart using (data0, angle0)
            PolarLineLayer layer0 = c.addLineLayer(data0, 0x9999ff, "Cold Spot");

            layer0.setAngles(angles0);

            // Disable the line by setting its width to 0, so only the symbols are visible
            layer0.setLineWidth(0);

            // Use a circular data point symbol
            layer0.setDataSymbol(Chart.CircleSymbol, 11);

            // Modulate the symbol size by size0 to produce a bubble chart effect
            layer0.setSymbolScale(size0);

            // Add a red (0xff9999) line layer to the chart using (data1, angle1)
            PolarLineLayer layer1 = c.addLineLayer(data1, 0xff9999, "Hot Spot");

            layer1.setAngles(angles1);

            // Disable the line by setting its width to 0, so only the symbols are visible
            layer1.setLineWidth(0);

            // Use a circular data point symbol
            layer1.setDataSymbol(Chart.CircleSymbol, 11);

            // Modulate the symbol size by size1 to produce a bubble chart effect
            layer1.setSymbolScale(size1);

            // Output the chart
            viewer.Chart = c;

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='{dataSetName} at ({value} km, {angle} deg)\nStrength = {z} Watt'");
        }
        //Main code for creating chart.
        //Note: the argument chartIndex is unused because this demo only has 1 chart.
        public void createChart(WPFChartViewer viewer, int chartIndex)
        {
            // The data for the chart
            double[] data = { 5.1, 1.5, 5.1, 4.0, 1.7, 8.7, 9.4, 2.1, 3.5, 8.8, 5.0, 6.0 };

            // The labels for the chart
            string[] labels = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept",
                                "Oct", "Nov", "Dec" };

            // Create a PolarChart object of size 400 x 420 pixels. with a metallic blue (9999ff)
            // background color and 1 pixel 3D border
            PolarChart c = new PolarChart(400, 420, Chart.metalColor(0x9999ff), 0x000000, 1);

            // Add a title to the chart using 16pt Arial Bold Italic font. The title text is white
            // (0xffffff) on deep blue (000080) background
            c.addTitle("Chemical Concentration", "Arial Bold Italic", 16, 0xffffff).setBackground(
                0x000080);

            // Set center of plot area at (200, 240) with radius 145 pixels. Set background color to
            // green (0x33ff33)
            c.setPlotArea(200, 240, 145, 0x33ff33);

            // Set the labels to the angular axis
            c.angularAxis().setLabels(labels);

            // Color the sector between label index = 5.5 to 7.5 as red (ff3333) zone
            c.angularAxis().addZone(5.5, 7.5, 0xff3333);

            // Color the sector between label index = 4.5 to 5.5, and also between 7.5 to 8.5, as
            // yellow (ff3333) zones
            c.angularAxis().addZone(4.5, 5.5, 0xffff00);
            c.angularAxis().addZone(7.5, 8.5, 0xffff00);

            // Set the grid style to circular grid
            c.setGridStyle(false);

            // Use semi-transparent (40ffffff) label background so as not to block the data
            c.radialAxis().setLabelStyle().setBackground(0x40ffffff, 0x40000000);

            // Add a legend box at (200, 30) top center aligned, using 9pt Arial Bold font. with a
            // black border.
            LegendBox legendBox = c.addLegend(200, 30, false, "Arial Bold", 9);

            legendBox.setAlignment(Chart.TopCenter);

            // Add legend keys to represent the red/yellow/green zones
            legendBox.addKey("Very Dry", 0xff3333);
            legendBox.addKey("Critical", 0xffff00);
            legendBox.addKey("Moderate", 0x33ff33);

            // Add a blue (0x80) line layer with line width set to 3 pixels and use purple (ff00ff)
            // cross symbols for the data points
            PolarLineLayer layer = c.addLineLayer(data, 0x000080);

            layer.setLineWidth(3);
            layer.setDataSymbol(Chart.Cross2Shape(), 15, 0xff00ff);

            // Output the chart
            viewer.Chart = c;

            // Include tool tip for the chart.
            viewer.ImageMap = layer.getHTMLImageMap("clickable", "",
                                                    "title='Concentration on {label}: {value} ppm'");
        }
Ejemplo n.º 9
0
        //Main code for creating chart.
        //Note: the argument img is unused because this demo only has 1 chart.
        public void createChart(WinChartViewer viewer, string img)
        {
            // The data for the chart
            double[] data0   = { 43, 89, 76, 64, 48, 18, 92, 68, 44, 79, 71, 85 };
            double[] angles0 = { 45, 96, 169, 258, 15, 30, 330, 260, 60, 75, 110, 140 }
            ;

            double[] data1   = { 50, 91, 26, 29, 80, 53, 62, 87, 19, 40 };
            double[] angles1 = { 230, 210, 240, 310, 179, 250, 244, 199, 89, 160 };

            double[] data2   = { 88, 65, 76, 49, 80, 53 };
            double[] angles2 = { 340, 310, 340, 210, 30, 300 };

            // The labels on the angular axis (spokes)
            string[] labels = { "North", "North\nEast", "East", "South\nEast",
                                "South", "South\nWest", "West", "North\nWest" };

            // Create a PolarChart object of size 460 x 460 pixels
            PolarChart c = new PolarChart(460, 460);

            // Add a title to the chart at the top left corner using 15pts Arial Bold
            // Italic font
            c.addTitle2(Chart.TopLeft, "<*underline=2*>Plants in Wonderland",
                        "Arial Bold Italic", 15);

            // Set center of plot area at (230, 240) with radius 180 pixels
            c.setPlotArea(230, 240, 180);

            // Use alternative light grey/dark grey sector background color
            c.setPlotAreaBg(0xdddddd, 0xeeeeee, false);

            // Set the grid style to circular grid
            c.setGridStyle(false);

            // Add a legend box at the top right corner of the chart using 9 pts
            // Arial Bold font
            c.addLegend(459, 0, true, "Arial Bold", 9).setAlignment(Chart.TopRight);

            // Set angular axis as 0 - 360, either 8 spokes
            c.angularAxis().setLinearScale2(0, 360, labels);

            // Set the radial axis label format
            c.radialAxis().setLabelFormat("{value} km");

            // Add a blue (0xff) polar line layer to the chart using (data0, angle0)
            PolarLineLayer layer0 = c.addLineLayer(data0, 0x0000ff, "Immortal Weed");

            layer0.setAngles(angles0);

            layer0.setLineWidth(0);
            layer0.setDataSymbol(Chart.TriangleSymbol, 11);

            // Add a red (0xff0000) polar line layer to the chart using (data1,
            // angles1)
            PolarLineLayer layer1 = c.addLineLayer(data1, 0xff0000, "Precious Flower"
                                                   );

            layer1.setAngles(angles1);

            // Disable the line by setting its width to 0, so only the symbols are
            // visible
            layer1.setLineWidth(0);

            // Use a 11 pixel diamond data point symbol
            layer1.setDataSymbol(Chart.DiamondSymbol, 11);

            // Add a green (0x00ff00) polar line layer to the chart using (data2,
            // angles2)
            PolarLineLayer layer2 = c.addLineLayer(data2, 0x00ff00, "Magical Tree");

            layer2.setAngles(angles2);

            // Disable the line by setting its width to 0, so only the symbols are
            // visible
            layer2.setLineWidth(0);

            // Use a 9 pixel square data point symbol
            layer2.setDataSymbol(Chart.SquareSymbol, 9);

            // Output the chart
            viewer.Image = c.makeImage();

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='{dataSetName} at ({value} km, {angle} deg)'");
        }
Ejemplo n.º 10
0
        // Acción que determina que clase utilitzar para crear los "Charts"
        public void CrearChart(Button button, Label label = null)
        {
            ClearLastElements();

            BaseChart.Chart.Series.RemoveAllSeries();

            //Themes.RefreshTheme();
            Themes.BasicAxes(BaseChart.Chart.Axes.Left, BaseChart.Chart.Axes.Right);
            Themes.AplicarTheme(BaseChart);

            switch (button.Text)
            {
            case "Line":
                lineChart = new LineChart(BaseChart);
                break;

            case "Column Bar":
                columnBarChart = new ColumnBarChart(BaseChart);
                break;

            case "Area":
                areaChart = new AreaChart(BaseChart);
                break;

            case "Pie":
                pieChart = new PieChart(BaseChart);
                break;

            case "Fast Line":
                fastLineChart = new FastLineChart(BaseChart);
                break;

            case "Horizontal Area":
                horizAreaChart = new HorizontalAreaChart(BaseChart);
                break;

            case "Horizontal Bar":
                horizBarChart = new HorizontalBarChart(BaseChart);
                break;

            case "Horizontal Line":
                horizLineChart = new HorizontalLineChart(BaseChart);
                break;

            case "Donut":
                donutChart = new DonutChart(BaseChart);
                break;

            case "Bubble":
                bubbleChart = new BubbleChart(BaseChart);
                break;

            case "Shape":
                shapeChart = new ShapeChart(BaseChart);
                break;

            case "Gantt":
                gantChart = new GanttChart(BaseChart);
                break;

            case "Point/Scatter":
                point_scatterChart = new Point_ScatterChart(BaseChart);
                break;

            case "Interpolating Line":
                interpolatingChart = new InterpolatingChartFeatures(BaseChart);
                break;

            case "Bar Styles":
                coneBarChart = new BarStylesChartFeatures(BaseChart);
                break;

            case "Zoom & Panning":
                zoomPaningArrowChart = new ZoomPanningChartFeatures(BaseChart);
                break;

            case "Bar Gradient":
                gradientBarChart = new GradientBarChartFeatures(BaseChart);
                break;

            case "Bubble Transparent":
                bubbleTranspChart = new BubbleTransparencyChartFeatures(BaseChart);
                break;

            case "Real Time":
                fLineRealTimeChart = new FLineRealTimeChartFeatures(BaseChart);
                break;

            case "Stack Area":
                stackAreaChart = new StackAreaChartFeatures(BaseChart);
                break;

            case "Multiple Pies":
                multiPiesChart = new MultiplePiesChartFeatures(BaseChart);
                break;

            case "Semi-Pie":
                semiPieChart = new Semi_PieChartFeatures(BaseChart);
                break;

            case "Semi-Donut":
                semiDonutChart = new Semi_DonutChartFeatures(BaseChart);
                break;

            case "Arrow":
                arrowChart = new ArrowChart(BaseChart);
                break;

            case "Polar":
                polarChart = new PolarChart(BaseChart);
                break;

            case "Radar":
                radarChart = new RadarChart(BaseChart);
                break;

            case "Pyramid":
                pyramidChart = new PyramidChart(BaseChart);
                break;

            case "Candle":
                candleChart = new CandleChart(BaseChart);
                break;

            case "Histogram":
                histogramChart = new HistogramChart(BaseChart);
                break;

            case "Error":
                errorChart = new ErrorChart(BaseChart);
                break;

            case "ErrorBar":
                errorBarChart = new ErrorBarChart(BaseChart);
                break;

            case "Funnel":
                funnelChart = new FunnelChart(BaseChart);
                break;

            case "Smith":
                smithChart = new SmithChart(BaseChart);
                break;

            case "Bezier":
                bezierChart = new BezierChart(BaseChart);
                break;

            case "HighLow":
                highLowChart = new HighLowChart(BaseChart);
                break;

            case "Speed Time":
                realTimeChart = new SpeedTimeChart(BaseChart);
                break;

            case "Waterfall":
                waterfallChart = new WaterfallChart(BaseChart);
                break;

            case "Volume":
                volumeChart = new VolumeChart(BaseChart);
                break;

            case "Color Grid":
                colorGridChart = new ColorGridChart(BaseChart);
                break;

            case "Polar Bar":
                polarBarChart = new PolarBarChart(BaseChart);
                break;

            case "Inverted Pyramid":
                invertedPyramidChart = new InvertedPyramidChart(BaseChart);
                break;

            case "Horizontal Histogram":
                horizHistogramChart = new HorizHistogramChart(BaseChart);
                break;

            case "Circular Gauge":
                basicCircGaugeChart = new BasicCircularGaugeChart(BaseChart);
                break;

            case "Car Fuel":
                carFuelChart = new CarFuelChart(BaseChart);
                break;

            case "Custom Hand":
                custPointerGaugeChart = new CustomPointerChart(BaseChart);
                break;

            case "Acceleration":
                accelerationCircularGaugeChart = new AccelerationCircularGaugeChart(BaseChart);
                break;

            case "Knob Gauge":
                basicKnobGaugeChart = new BasicKnobGaugeChart(BaseChart);
                break;

            case "Temperature Knob":
                temperatureKnobChart = new TemperatureKnobChart(BaseChart);
                break;

            case "Compass":
                try { compassChart = new CompassChart(BaseChart); }
                catch (Exception e) {  }
                break;

            case "Map GIS":
                mapGSIChart = new MapGISChart(BaseChart);
                break;

            case "World Map":
                worldMapChart = new WorldMapChart(BaseChart);
                break;

            case "TreeMap":
                treeMapChart = new TreeMapChart(BaseChart);
                break;

            case "Basic Clock":
                basicClockChart = new BasicClockChart(BaseChart);
                break;

            case "Custom Clock":
                customClockChart = new CustomClockChart(BaseChart);
                break;

            case "Organizational Chart":
                basicOrganizationalChart = new BasicOrganizationalChart(BaseChart);
                break;

            case "Numeric Gauge":
                numericGaugeChart = new NumericGaugeChart(BaseChart);
                break;

            case "Linear Gauge":
                linearGaugeChart = new LinearGaugeChart(BaseChart);
                break;

            case "Scales":
                scalesLinearChart = new ScalesLinearChart(BaseChart);
                break;

            case "SubLines":
                moreLinesLinearChart = new MoreLinesLinearChart(BaseChart);
                break;

            case "Mobile Battery":
                batteryLinearChart = new BatteryLinearChart(BaseChart);
                break;

            case "Basic Calendar":
                basicCalendarChart = new BasicCalendarChart(BaseChart, label);
                break;

            case "Special Dates":
                specialDatesChart = new SpecialDatesChart(BaseChart, label);
                break;

            case "TagCloud":
                tagCloudChart = new TagCloudChart(BaseChart);
                break;

            case "Add":
                addStdFunctionsChart = new AddStdFunctionsChart(BaseChart);
                break;

            case "Subtract":
                subtStdFunctionsChart = new SubtStdFunctionsChart(BaseChart);
                break;

            case "Multiply":
                multStdFunctionsChart = new MultStdFunctionsChart(BaseChart);
                break;

            case "Divide":
                divStdFunctionsChart = new DivStdFunctionsChart(BaseChart);
                break;

            case "Count":
                countStdFunctionsChart = new CountStdFunctionsChart(BaseChart);
                break;

            case "Average":
                avgStdFunctionsChart = new AvgStdFunctionsChart(BaseChart);
                break;

            case "High":
                highStdFunctionsChart = new HighStdFunctionsChart(BaseChart);
                break;

            case "Low":
                lowStdFunctionsChart = new LowStdFunctionsChart(BaseChart);
                break;

            case "Median Function":
                medianStdFunctionsChart = new MedianStdFunctionsChart(BaseChart);
                break;

            case "Percent Change":
                percentStdFunctionsChart = new PercentStdFunctionsChart(BaseChart);
                break;

            case "ADX":
                adxProFunctionChart = new ADXProFunctionChart(BaseChart);
                break;

            case "AC":
                acProFunctionChart = new ACProFunctionChart(BaseChart);
                break;

            case "Alligator":
                alligatorProFunctionChart = new AlligatorProFunctionChart(BaseChart);
                break;

            case "AO":
                aoProFunctionChart = new AOProFunctionChart(BaseChart);
                break;

            case "ATR":
                atrProFunctionChart = new ATRProFunctionChart(BaseChart);
                break;

            case "Bollinger Bands":
                bollingerProFunctionChart = new BollingerProFunctionChart(BaseChart);
                break;

            case "CCI":
                cciProFunctionChart = new CCIProFunctionChart(BaseChart);
                break;

            case "CLV":
                clvProFunctionChart = new CLVProFunctionChart(BaseChart);
                break;

            case "Compression OHLC":
                compressionOHLCProFunctionChart = new CompressionOHLCProFunctionChart(BaseChart);
                break;

            case "Exp. Average":
                expAverageProFunctionChart = new ExpAverageProFunctionChart(BaseChart);
                break;

            case "Exp. Moving Average":
                expMovAverageProFunctionChart = new ExpMovAverageProFunctionChart(BaseChart);
                break;

            case "Gator Oscillator":
                gatorOscillProFunctionChart = new GatorOscillProFunctionChart(BaseChart);
                break;

            case "Kurtosis":
                kurtosisProFunctionChart = new KurtosisProFunctionChart(BaseChart);
                break;

            case "MACD":
                macdProFunctionChart = new MACDProFunctionChart(BaseChart);
                break;

            case "Momentum":
                momentumProFunctionChart = new MomentumProFunctionChart(BaseChart);
                break;

            case "Momentum Div.":
                momentumDivProFunctionChart = new MomentumDivProFunctionChart(BaseChart);
                break;

            case "Money Flow":
                moneyFlowProFunctionChart = new MoneyFlowProFunctionChart(BaseChart);
                break;

            case "OBV":
                obvProFunctionChart = new OBVProFunctionChart(BaseChart);
                break;

            case "PVO":
                pvoProFunctionChart = new PVOProFunctionChart(BaseChart);
                break;

            case "RSI":
                rsiProFunctionChart = new RSIProFunctionChart(BaseChart);
                break;

            case "RVI":
                rviProFunctionChart = new RVIProFunctionChart(BaseChart);
                break;

            case "Slope":
                slopeProFunctionChart = new SlopeProFunctionChart(BaseChart);
                break;

            case "Smoothed Mov Avg":
                smoothMovAvgProFunctionChart = new SmoothMovAvgProFunctionChart(BaseChart);
                break;

            case "S.A.R.":
                sarProFunctionChart = new SARProFunctionChart(BaseChart);
                break;

            case "Cross Point":
                crossPointsProFunctionsChart = new CrossPointsProFunctionsChart(BaseChart);
                break;

            case "Correlation":
                correlationProFunctionChart = new CorrelationProFunctionChart(BaseChart);
                break;

            case "Cumulative":
                cumulativeProFunctionChart = new CumulativeProFunctionChart(BaseChart);
                break;

            case "Custom Function":
                calculateEventProFunctionChart = new CalculateEventProFunctionChart(BaseChart);
                break;

            case "Exponential Trend":
                exponentialTrendProFunctionChart = new ExponentialTrendProFunctionChart(BaseChart);
                break;

            case "Fitting Linearizable":
                fittingProFunctionChart = new FittingProFunctionChart(BaseChart);
                break;

            case "Performance":
                performanceProFunctionChart = new PerformanceProFunctionChart(BaseChart);
                break;

            case "Perimeter":
                perimeterProFunctionChart = new PerimeterProFunctionChart(BaseChart);
                break;

            case "Finding Coefficients":
                findCoeffProFunctionChart = new FindCoeffProFunctionChart(BaseChart);
                break;

            case "Down Sampling":
                downSamplingProFunctionChart = new DownSamplingProFunctionChart(BaseChart);
                break;

            case "RMS":
                rmsProFunctionChart = new RMSProFunctionChart(BaseChart);
                break;

            case "Smoothing Function":
                smoothingProFunctionChart = new SmoothingProFunctionChart(BaseChart);
                break;

            case "Standard Deviation":
                stdDeviationProFunctionChart = new StdDeviationProFunctionChart(BaseChart);
                break;

            case "Trendline":
                trendlineProFunctionChart = new TrendlineProFunctionChart(BaseChart);
                break;

            case "Variance":
                varianceProFunctionChart = new VarianceProFunctionChart(BaseChart);
                break;

            case "SPC":
                spcProFunctionChart = new SPCProFunctionChart(BaseChart);
                break;

            case "Cumulative Histogram":
                cumulativeHistogProFunctionChart = new CumulativeHistogProFunctionChart(BaseChart);
                break;

            case "Skewness":
                skewnessProFunctionChart = new SkewnessProFunctionChart(BaseChart);
                break;
            }

            Themes.AplicarOptions(BaseChart);
        }
Ejemplo n.º 11
0
        //Main code for creating chart.
        //Note: the argument img is unused because this demo only has 1 chart.
        public void createChart(WinChartViewer viewer, string img)
        {
            // The data for the chart
            double[] data = { 51, 15, 51, 40, 17, 87, 94, 21, 35, 88, 50, 60 };

            // The labels for the chart
            string[] labels = { "Jan", "Feb",  "Mar", "Apr", "May", "Jun", "Jul",
                                "Aug", "Sept", "Oct", "Nov", "Dec" };

            // Create a PolarChart object of size 400 x 420 pixels
            PolarChart c = new PolarChart(400, 420);

            // Set background color to a 2 pixel pattern color, with a black border
            // and 1 pixel 3D border effect
            c.setBackground(c.patternColor(new int[] { 0xffffff, 0xe0e0e0 }, 2), 0, 1);

            // Add a title to the chart using 16 pts Arial Bold Italic font. The
            // title text is white (0xffffff) on 2 pixel pattern background
            c.addTitle("Chemical Concentration", "Arial Bold Italic", 16, 0xffffff
                       ).setBackground(c.patternColor(new int[] { 0x000000, 0x000080 }, 2));

            // Set center of plot area at (200, 240) with radius 145 pixels. Set
            // background color to blue (9999ff)
            c.setPlotArea(200, 240, 145, 0x9999ff);

            // Color the region between radius = 40 to 80 as green (99ff99)
            c.radialAxis().addZone(40, 80, 0x99ff99);

            // Color the region with radius > 80 as red (ff9999)
            c.radialAxis().addZone(80, 999, 0xff9999);

            // Set the grid style to circular grid
            c.setGridStyle(false);

            // Set the radial axis label format
            c.radialAxis().setLabelFormat("{value} ppm");

            // Use semi-transparent (40ffffff) label background so as not to block
            // the data
            c.radialAxis().setLabelStyle().setBackground(0x40ffffff, 0x40000000);

            // Add a legend box at (200, 30) top center aligned, using 9 pts Arial
            // Bold font. with a black border.
            LegendBox legendBox = c.addLegend(200, 30, false, "Arial Bold", 9);

            legendBox.setAlignment(Chart.TopCenter);

            // Add legend keys to represent the red/green/blue zones
            legendBox.addKey("Under-Absorp", 0x9999ff);
            legendBox.addKey("Normal", 0x99ff99);
            legendBox.addKey("Over-Absorp", 0xff9999);

            // Add a blue (000080) spline line layer with line width set to 3 pixels
            // and using yellow (ffff00) circles to represent the data points
            PolarSplineLineLayer layer = c.addSplineLineLayer(data, 0x000080);

            layer.setLineWidth(3);
            layer.setDataSymbol(Chart.CircleShape, 11, 0xffff00);

            // Set the labels to the angular axis as spokes.
            c.angularAxis().setLabels(labels);

            // Output the chart
            viewer.Image = c.makeImage();

            // Include tool tip for the chart.
            viewer.ImageMap = layer.getHTMLImageMap("clickable", "",
                                                    "title='Concentration on {label}: {value} ppm'");
        }
Ejemplo n.º 12
0
        //Main code for creating chart.
        //Note: the argument img is unused because this demo only has 1 chart.
        public void createChart(WinChartViewer viewer, string img)
        {
            // The data for the chart
            double[] data0 = { 100, 100, 100, 100, 100 };
            double[] data1 = { 90, 85, 85, 80, 70 };
            double[] data2 = { 80, 65, 65, 75, 45 };

            // The labels for the chart
            string[] labels = { "Population<*br*><*font=Arial*>6 millions",
                                "GDP<*br*><*font=Arial*>120 billions",
                                "Export<*br*><*font=Arial*>25 billions",
                                "Import<*br*><*font=Arial*>24 billions",
                                "Investments<*br*><*font=Arial*>20 billions" };

            // Create a PolarChart object of size 480 x 460 pixels. Set background
            // color to silver, with 1 pixel 3D border effect
            PolarChart c = new PolarChart(480, 460, Chart.silverColor(), 0x000000, 1)
            ;

            // Add a title to the chart using 15 pts Times Bold Italic font. The
            // title text is white (ffffff) on a deep green (008000) background
            c.addTitle("Economic Growth", "Times New Roman Bold Italic", 15, 0xffffff
                       ).setBackground(0x008000);

            // Set plot area center at (240, 270), with 150 pixels radius
            c.setPlotArea(240, 270, 150);

            // Use 1 pixel width semi-transparent black (c0000000) lines as grid
            // lines
            c.setGridColor(unchecked ((int)0xc0000000), 1, unchecked ((int)0xc0000000),
                           1);

            // Add a legend box at top-center of plot area (240, 35) using horizontal
            // layout. Use 10 pts Arial Bold font, with silver background and 1 pixel
            // 3D border effect.
            LegendBox b = c.addLegend(240, 35, false, "Arial Bold", 10);

            b.setAlignment(Chart.TopCenter);
            b.setBackground(Chart.silverColor(), Chart.Transparent, 1);

            // Add area layers of different colors to represent the data
            c.addAreaLayer(data0, 0xcc8880, "Year 2004");
            c.addAreaLayer(data1, 0xffd080, "Year 1994");
            c.addAreaLayer(data2, 0xa0bce0, "Year 1984");

            // Set the labels to the angular axis as spokes.
            c.angularAxis().setLabels(labels);

            // Set radial axis from 0 - 100 with a tick every 20 units
            c.radialAxis().setLinearScale(0, 100, 20);

            // Just show the radial axis as a grid line. Hide the axis labels by
            // setting the label color to Transparent
            c.radialAxis().setColors(unchecked ((int)0xc0000000), Chart.Transparent);

            // Output the chart
            viewer.Image = c.makeImage();

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='Current {label}: {value}% in {dataSetName}'");
        }