예제 #1
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 line chart
            double[] data = { 30, 28, 40, 55, 75, 68, 54, 60, 50, 62, 75, 65, 75, 91,
                              60, 55, 53, 35, 50, 66, 56, 48, 52, 65, 62 };

            // The labels for the line chart
            string[] labels = { "0",  "1",  "2",  "3",  "4",  "5",  "6",  "7",  "8",  "9",
                                "10", "11", "12", "13", "14", "15", "16", "17", "18", "19","20",
                                "21", "22", "23", "24" };

            // Create a XYChart object of size 250 x 250 pixels
            XYChart c = new XYChart(250, 250);

            // Set the plotarea at (30, 20) and of size 200 x 200 pixels
            c.setPlotArea(30, 20, 200, 200);

            // Add a line chart layer using the given data
            c.addLineLayer(data);

            // Set the labels on the x axis.
            c.xAxis().setLabels(labels);

            // Display 1 out of 3 labels on the x-axis.
            c.xAxis().setLabelStep(3);

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

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='Hour {xLabel}: Traffic {value} GBytes'");
        }
예제 #2
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  = { 0.05, 0.06, 0.48, 0.1, 0.01, 0.05 };
            double[] data1  = { 100, 125, 265, 147, 67, 105 };
            string[] labels = { "Jan", "Feb", "Mar", "Apr", "May", "Jun" };

            // Create a XYChart object of size 300 x 180 pixels
            XYChart c = new XYChart(300, 180);

            // Set the plot area at (50, 20) and of size 200 x 130 pixels
            c.setPlotArea(50, 20, 200, 130);

            // Add a title to the chart using 8 pts Arial Bold font
            c.addTitle("Independent Y-Axis Demo", "Arial Bold", 8);

            // Set the labels on the x axis.
            c.xAxis().setLabels(labels);

            // Add a title to the primary (left) y axis
            c.yAxis().setTitle("Packet Drop Rate (pps)");

            // Set the axis, label and title colors for the primary y axis to red
            // (0xc00000) to match the first data set
            c.yAxis().setColors(0xc00000, 0xc00000, 0xc00000);

            // Add a title to the secondary (right) y axis
            c.yAxis2().setTitle("Throughtput (MBytes)");

            // set the axis, label and title colors for the primary y axis to green
            // (0x008000) to match the second data set
            c.yAxis2().setColors(0x008000, 0x008000, 0x008000);

            // Add a line layer to for the first data set using red (0xc00000) color
            // with a line width to 3 pixels
            LineLayer lineLayer = c.addLineLayer(data0, 0xc00000);

            lineLayer.setLineWidth(3);

            // tool tip for the line layer
            lineLayer.setHTMLImageMap("", "",
                                      "title='Packet Drop Rate on {xLabel}: {value} pps'");

            // Add a bar layer to for the second data set using green (0x00C000)
            // color. Bind the second data set to the secondary (right) y axis
            BarLayer barLayer = c.addBarLayer(data1, 0x00c000);

            barLayer.setUseYAxis2();

            // tool tip for the bar layer
            barLayer.setHTMLImageMap("", "",
                                     "title='Throughput on {xLabel}: {value} MBytes'");

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

            // include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable");
        }
 protected override Image DoCreateChartImage()
 {
     var chart = new XYChart(Parameters.ChartWidth, Parameters.ChartHeight);
     chart.setPlotArea(30, 20, (int)Math.Round(Parameters.ChartWidth - (Parameters.ChartWidth * 0.2)), (int)Math.Round(Parameters.ChartHeight - (Parameters.ChartHeight * 0.2)));
     chart.addLineLayer(Parameters.SeriaData.Select(p => (double)p.Key).ToArray());
     chart.xAxis().setLabelStep(3);
     return chart.makeImage();
 }
예제 #4
0
        public void LoadChart(double[] data)
        {
            // The data for the line chart
            //  double[] data0 = { 60.2, 51.7, 81.3, 48.6, 56.2, 68.9, 52.8 };
            //  double[] data1 = { 30.0, 32.7, 33.9, 29.5, 32.2, 28.4, 29.8 };
            string[] labels = new string [31];
            for (int iDay = 0; iDay < 31; iDay++)
            {
                labels[iDay] = ((int)(iDay + 1)).ToString();
            }
            // Create a XYChart object of size 300 x 180 pixels, with a pale yellow
            // (0xffffc0) background, a black border, and 1 pixel 3D border effect.
            //834, 207
            XYChart c = new XYChart(800, 190, 0xffffc0, 0x000000, 1);

            // Set the plotarea at (45, 35) and of size 240 x 120 pixels, with white
            // background. Turn on both horizontal and vertical grid lines with light
            // grey color (0xc0c0c0)
            c.setPlotArea(30, 20, 760, 150, 0xffffff, -1, -1, 0xc0c0c0, -1);

            // Add a legend box at (45, 12) (top of the chart) using horizontal
            // layout and 8 pts Arial font Set the background and border color to
            // Transparent.
            c.addLegend(45, 12, false, "", 8).setBackground(Chart.Transparent);

            // Add a title to the chart using 9 pts Arial Bold/white font. Use a 1 x
            // 2 bitmap pattern as the background.
            c.addTitle("Biều đồ khách môi giới theo ngày (Tháng " + calTuNgay.Value.Month.ToString() + " )", "Arial Bold", 9, 0xffffff
                       ).setBackground(c.patternColor(new int[] { 0x004000, 0x008000 }, 2));

            // Set the y axis label format to nn%
            c.yAxis().setLabelFormat("{value}");

            // Set the labels on the x axis
            c.xAxis().setLabels(labels);

            // Add a line layer to the chart
            LineLayer layer = c.addLineLayer();

            // Add the first line. Plot the points with a 7 pixel square symbol
            layer.addDataSet(data, 0xcf4040, "Số xe đón").setDataSymbol(
                Chart.SquareSymbol, 7);


            // Enable data label on the data points. Set the label format to nn%.
            layer.setDataLabelFormat("{value|0}");

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

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='{xLabel}: {dataSetName} {value}'");
        }
예제 #5
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 line chart
            double[] data0  = { 60.2, 51.7, 81.3, 48.6, 56.2, 68.9, 52.8 };
            double[] data1  = { 30.0, 32.7, 33.9, 29.5, 32.2, 28.4, 29.8 };
            string[] labels = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };

            // Create a XYChart object of size 300 x 180 pixels, with a pale yellow
            // (0xffffc0) background, a black border, and 1 pixel 3D border effect.
            XYChart c = new XYChart(300, 180, 0xffffc0, 0x000000, 1);

            // Set the plotarea at (45, 35) and of size 240 x 120 pixels, with white
            // background. Turn on both horizontal and vertical grid lines with light
            // grey color (0xc0c0c0)
            c.setPlotArea(45, 35, 240, 120, 0xffffff, -1, -1, 0xc0c0c0, -1);

            // Add a legend box at (45, 12) (top of the chart) using horizontal
            // layout and 8 pts Arial font Set the background and border color to
            // Transparent.
            c.addLegend(45, 12, false, "", 8).setBackground(Chart.Transparent);

            // Add a title to the chart using 9 pts Arial Bold/white font. Use a 1 x
            // 2 bitmap pattern as the background.
            c.addTitle("Server Load (Jun 01 - Jun 07)", "Arial Bold", 9, 0xffffff
                       ).setBackground(c.patternColor(new int[] { 0x004000, 0x008000 }, 2));

            // Set the y axis label format to nn%
            c.yAxis().setLabelFormat("{value}%");

            // Set the labels on the x axis
            c.xAxis().setLabels(labels);

            // Add a line layer to the chart
            LineLayer layer = c.addLineLayer();

            // Add the first line. Plot the points with a 7 pixel square symbol
            layer.addDataSet(data0, 0xcf4040, "Peak").setDataSymbol(
                Chart.SquareSymbol, 7);

            // Add the second line. Plot the points with a 9 pixel dismond symbol
            layer.addDataSet(data1, 0x40cf40, "Average").setDataSymbol(
                Chart.DiamondSymbol, 9);

            // Enable data label on the data points. Set the label format to nn%.
            layer.setDataLabelFormat("{value|0}%");

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

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='{xLabel}: {dataSetName} {value}%'");
        }
예제 #6
0
        private void drawFullChart(WPFViewPortControl vpc, WPFChartViewer viewer)
        {
            // Create an XYChart object of size 640 x 60 pixels
            XYChart c = new XYChart(640, 60);

            // Set the plotarea with the same horizontal position as that in the main chart for alignment.
            c.setPlotArea(55, 0, c.getWidth() - 80, c.getHeight() - 1, 0xc0d8ff, -1, 0x888888,
                          Chart.Transparent, 0xffffff);

            // Set the x axis stem to transparent and the label font to 10pt Arial
            c.xAxis().setColors(Chart.Transparent);
            c.xAxis().setLabelStyle("Arial", 10);

            // Put the x-axis labels inside the plot area by setting a negative label gap. Use
            // setLabelAlignment to put the label at the right side of the tick.
            c.xAxis().setLabelGap(-1);
            c.xAxis().setLabelAlignment(1);

            // Set the y axis stem and labels to transparent (that is, hide the labels)
            c.yAxis().setColors(Chart.Transparent, Chart.Transparent);

            // Add a line layer for the lines with fast line mode enabled
            LineLayer layer = c.addLineLayer();

            layer.setFastLineMode();

            // Now we add the 3 data series to a line layer, using the color red (0xff3333), green
            // (0x008800) and blue (0x3333cc)
            layer.setXData(timeStamps);
            layer.addDataSet(dataSeriesA, 0xff3333);
            layer.addDataSet(dataSeriesB, 0x008800);
            layer.addDataSet(dataSeriesC, 0x3333cc);

            // The x axis scales should reflect the full range of the view port
            c.xAxis().setDateScale(viewer.getValueAtViewPort("x", 0), viewer.getValueAtViewPort("x", 1));

            // For the automatic x-axis labels, set the minimum spacing to 75 pixels.
            c.xAxis().setTickDensity(75);

            // For the auto-scaled y-axis, as we hide the labels, we can disable axis rounding. This can
            // make the axis scale fit the data tighter.
            c.yAxis().setRounding(false, false);

            // Output the chart
            vpc.Chart = c;
        }
예제 #7
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 line chart
            double[] data = { 30, 28, 40, 55, 75, 68, 54, 60, 50, 62, 75, 65, 75, 91,
                              60, 55, 53, 35, 50, 66, 56, 48, 52, 65, 62 };

            // The labels for the line chart
            string[] labels = { "0",  "1",  "2",  "3",  "4",  "5",  "6",  "7",  "8",  "9",
                                "10", "11", "12", "13", "14", "15", "16", "17", "18", "19","20",
                                "21", "22", "23", "24" };

            // Create a XYChart object of size 300 x 280 pixels
            XYChart c = new XYChart(300, 280);

            // Set the plotarea at (45, 30) and of size 200 x 200 pixels
            c.setPlotArea(45, 30, 200, 200);

            // Add a title to the chart using 12 pts Arial Bold Italic font
            c.addTitle("Daily Server Utilization", "Arial Bold Italic", 12);

            // Add a title to the y axis
            c.yAxis().setTitle("MBytes");

            // Add a title to the x axis
            c.xAxis().setTitle("June 12, 2001");

            // Add a blue (0x6666ff) 3D line chart layer using the give data
            c.addLineLayer(data, 0x6666ff).set3D();

            // Set the labels on the x axis.
            c.xAxis().setLabels(labels);

            // Display 1 out of 3 labels on the x-axis.
            c.xAxis().setLabelStep(3);

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

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='Hour {xLabel}: {value} MBytes'");
        }
예제 #8
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)
        {
            // In this example, we simply use random data for the 2 data series.
            RanSeries r = new RanSeries(127);

            double[]   data0      = r.getSeries(180, 70, -5, 5);
            double[]   data1      = r.getSeries(180, 150, -15, 15);
            DateTime[] timeStamps = r.getDateSeries(180, new DateTime(2014, 3, 1), 86400);

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

            // Set default text color to dark grey (0x333333)
            c.setColor(Chart.TextColor, 0x333333);

            // Add a title box using grey (0x555555) 20pt Arial Bold font
            c.addTitle("   Plasma Stabilizer Energy Usage", "Arial Bold", 20, 0x555555);

            // Set the plotarea at (70, 70) and of size 540 x 320 pixels, with transparent
            // background and border and light grey (0xcccccc) horizontal grid lines
            c.setPlotArea(70, 70, 540, 320, -1, -1, Chart.Transparent, 0xcccccc);

            // Add a legend box with horizontal layout above the plot area at (70, 32). Use 12pt
            // Arial Bold dark grey (0x555555) font, transparent background and border, and line
            // style legend icon.
            LegendBox b = c.addLegend(70, 32, false, "Arial Bold", 12);

            b.setFontColor(0x555555);
            b.setBackground(Chart.Transparent, Chart.Transparent);
            b.setLineStyleKey();

            // Set axis label font to 12pt Arial
            c.xAxis().setLabelStyle("Arial", 12);
            c.yAxis().setLabelStyle("Arial", 12);

            // Set the x and y axis stems to transparent, and the x-axis tick color to grey
            // (0xaaaaaa)
            c.xAxis().setColors(Chart.Transparent, Chart.TextColor, Chart.TextColor, 0xaaaaaa);
            c.yAxis().setColors(Chart.Transparent);

            // Set the major/minor tick lengths for the x-axis to 10 and 0.
            c.xAxis().setTickLength(10, 0);

            // For the automatic axis labels, set the minimum spacing to 80/40 pixels for the x/y
            // axis.
            c.xAxis().setTickDensity(80);
            c.yAxis().setTickDensity(40);

            // Use "mm/yyyy" as the x-axis label format for the first plotted month of a year, and
            // "mm" for other months
            c.xAxis().setMultiFormat(Chart.StartOfYearFilter(), "{value|mm/yyyy} ",
                                     Chart.StartOfMonthFilter(), "{value|mm}");

            // Add a title to the y axis using dark grey (0x555555) 12pt Arial Bold font
            c.yAxis().setTitle("Energy (kWh)", "Arial Bold", 14, 0x555555);

            // Add a line layer with 2-pixel line width
            LineLayer layer0 = c.addLineLayer(data0, 0xcc0000, "Power Usage");

            layer0.setXData(timeStamps);
            layer0.setLineWidth(2);

            // Add an area layer using semi-transparent blue (0x7f0044cc) as the fill color
            AreaLayer layer1 = c.addAreaLayer(data1, 0x7f0044cc, "Effective Load");

            layer1.setXData(timeStamps);
            layer1.setBorderColor(Chart.SameAsMainColor);

            // Output the chart
            viewer.Chart = c;

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='[{x|mm dd, yyyy}] {value} kWh'");
        }
예제 #9
0
    private void SetDatelyProductGraph()
    {
        this.pnlMonth.Visible = false;
        DateTime DateFrom = this.ctlDateFrom.DateValue;
        DateTime DateTo = this.ctlDateTo.DateValue;
        string BarcodeFrom = this.txtBarcodeFrom.Text;
        string BarcodeTo = this.txtBarcodeTo.Text;
        DateTime temp = DateFrom;
        if (DateFrom > DateTo)
        {
            DateFrom = DateTo;
            DateTo = temp;
        }
        string[] labels = GetDateXLabel(DateFrom, DateTo);
        XYChart c = new XYChart(750, 380, 15663086, 14540253, 0);
        string title = GetReportTitle() + (DateFrom == DateTo ? "ã¹Çѹ·Õè " + DateFrom.ToString() : " µÑé§áµèÇѹ·Õè " + DateFrom.ToString().Substring(0, 9) + "-" + DateTo.ToString().Substring(0, 9));

        c.addTitle(title, "Tahoma Bold", 12);
        c.setPlotArea(70, 80, 640, 230, c.gradientColor(0, 60, 0, 350, 16777215, 11189196), -1, Chart.Transparent, 1111);
        c.addLegend(30, 25, false, "Tahoma Bold", 8).setBackground(Chart.Transparent); c.xAxis().setLabels(labels);
        c.yAxis().setTickDensity(30);
        c.xAxis().setLabelStyle("Tahoma", 8, 001122, 90);
        c.yAxis().setLabelStyle("Tahoma", 8);
        c.yAxis().setLabelFormat("{value|0,}");
        c.xAxis().setWidth(2);
        c.yAxis().setWidth(2);
        c.yAxis().setTitle("¨Ó¹Ç¹ÊÔ¹¤éÒ/Çѵ¶Ø´Ôº", "Tahoma Bold", 10);
        c.xAxis().setTitle("Çѹ·Õè", "Tahoma Bold", 10);

        c.xAxis().setLabels(labels);


        LineLayer layer = c.addLineLayer();
        layer.setLineWidth(1);
        AddDateData(layer, DateFrom, DateTo, BarcodeFrom, BarcodeTo);
        vwChart.Image = c.makeWebImage(Chart.PNG);
        vwChart.ImageMap = c.getHTMLImageMap("", "",
            "title='{dataSetName} ã¹Çѹ·Õè {xLabel}\r\n{value|,} ÃÒ¡Òà ({percent}%)'");
    }
예제 #10
0
    private void SetYearlyGraph()
    {
        int yearFrom = Convert.ToInt32((txtYearFrom.Text.Trim() == "" ? "0" : txtYearFrom.Text.Trim())) - 543;
        int yearTo = Convert.ToInt32((txtYearTo.Text.Trim() == "" ? "0" : txtYearTo.Text.Trim())) - 543;
        if (yearFrom < 0)
            yearFrom = 0;
        if (yearTo < 0)
            yearTo = 0;
        int tmp = yearFrom;
        if (yearFrom > yearTo)
        {
            yearFrom = yearTo;
            yearTo = tmp;
        }
        yearFrom += 543;
        yearTo += 543;

        string[] labels = { "Á.¤.", "¡.¾.", "ÁÕ.¤.", "àÁ.Â.", "¾.¤.", "ÁÔ.Â.", "¡.¤.", "Ê.¤.", "¡.Â.", "µ.¤.", "¾.Â.", "¸.¤." };

        XYChart c = new XYChart(750, 380, 15663086, 14540253, 0);
        string title = GetTitle() + (yearFrom == yearTo ? "ã¹»Õ ¾.È. " + yearFrom.ToString() : " µÑé§áµè»Õ ¾.È. " + yearFrom.ToString() + "-" + yearTo.ToString());
        c.addTitle(title, "Tahoma Bold", 12);

        c.setPlotArea(70, 80, 640, 230, c.gradientColor(0, 60, 0, 350, 16777215, 11189196), -1, Chart.Transparent, 1111);

        c.addLegend(30, 25, false, "Tahoma Bold", 8).setBackground(Chart.Transparent);
        c.xAxis().setLabels(labels);
        c.yAxis().setTickDensity(30);
        c.xAxis().setLabelStyle("Tahoma", 8, 001122, 90);
        c.yAxis().setLabelStyle("Tahoma", 8);
        c.yAxis().setLabelFormat("{value|0,}");
        c.xAxis().setWidth(2);
        c.yAxis().setWidth(2);
        c.yAxis().setTitle("¨Ó¹Ç¹", "Tahoma Bold", 10);
        c.xAxis().setTitle("à´×͹", "Tahoma Bold", 10);

        LineLayer layer = c.addLineLayer();
        layer.setLineWidth(1);
        AddData(layer, yearFrom - 543, yearTo - 543);
        vwChart.Image = c.makeWebImage(Chart.PNG);
        vwChart.ImageMap = c.getHTMLImageMap(GetReportPath() + "?type=" + Request["type"] + "&warehouse=" + this.cmbWarehouse.SelectedItem.Value.ToString() + "&producttype=" + this.cmbProductType.SelectedItem.Value.ToString() + "&productgroup=" + this.cmbProductGroup.SelectedItem.Value.ToString() + "&product=" + this.cmbProduct.SelectedItem.Value.ToString() + "&currentyear={xLabel}&yearfrom=" + yearFrom.ToString() + "&yearto=" + yearTo.ToString(), "",
            "title='»Õ {dataSetName} à´×͹ {xLabel}\r\n{value|,} ÃÒ¡Òà ({percent}%)'");
    }
예제 #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)
        {
            // Data for the chart
            double[] data0 = { 1700, 3900, 2900, 3800, 4100, 4600, 2900, 4100, 4400,
                               5700, 5900, 5200, 3700, 3400, 5100, 5600, 5600, 6000, 7000, 7600,
                               6300, 6700, 7500, 6400, 8800 };
            double[] data1 = { 500, 550, 670, 990, 820, 730, 800, 720, 730, 790, 860,
                               800, 840, 680, 740, 890, 680, 790, 730, 770, 840, 820, 800, 840, 670 }

            ;
            double[] data2 = { 46, 68, 35, 33, 38, 20, 12, 18, 15, 23, 30, 24, 28, 15,
                               21, 26, 46, 42, 38, 25, 23, 32, 24, 20, 25 };
            double[] data3 = { 0.84, 0.82, 0.82, 0.38, 0.25, 0.52, 0.54, 0.52, 0.38,
                               0.51, 0.46, 0.29,  0.5, 0.55, 0.47, 0.34, 0.52, 0.33,0.21, 0.3, 0.25,
                               0.15, 0.18, 0.22, 0.14 };

            // Labels for the chart
            string[] labels = { "0",  "1",  "2",  "3",  "4",  "5",  "6",  "7",  "8",  "9",
                                "10", "11", "12", "13", "14", "15", "16", "17", "18", "19","20",
                                "21", "22", "23", "24" };

            // Create a XYChart object of size 600 x 360 pixels. Use a vertical
            // gradient color from sky blue (aaccff) to white (ffffff) as background.
            // Set border to grey (888888). Use rounded corners. Enable soft drop
            // shadow.
            XYChart c = new XYChart(600, 360);

            c.setBackground(c.linearGradientColor(0, 0, 0, c.getHeight(), 0xaaccff,
                                                  0xffffff), 0x888888);
            c.setRoundedFrame();
            c.setDropShadow();

            // Add a title box to the chart using 15 pts Arial Bold Italic font. Set
            // top margin to 16 pixels.
            ChartDirector.TextBox title = c.addTitle("Multiple Axes Demonstration",
                                                     "Arial Bold Italic", 15);
            title.setMargin2(0, 0, 16, 0);

            // Set the plotarea at (100, 80) and of size 400 x 230 pixels, with white
            // (ffffff) background. Use grey #(aaaaa) dotted lines for both
            // horizontal and vertical grid lines.
            c.setPlotArea(100, 80, 400, 230, 0xffffff, -1, -1, c.dashLineColor(
                              0xaaaaaa, Chart.DotLine), -1);

            // Add a legend box with the bottom center anchored at (300, 80) (top
            // center of the plot area). Use horizontal layout, and 8 points Arial
            // Bold font. Set background and border to transparent.
            LegendBox legendBox = c.addLegend(300, 80, false, "Arial Bold", 8);

            legendBox.setAlignment(Chart.BottomCenter);
            legendBox.setBackground(Chart.Transparent, Chart.Transparent);

            // Set the labels on the x axis.
            c.xAxis().setLabels(labels);

            // Display 1 out of 3 labels on the x-axis.
            c.xAxis().setLabelStep(3);

            // Add a title to the x-axis
            c.xAxis().setTitle("Hour of Day");

            // Add a title on top of the primary (left) y axis.
            c.yAxis().setTitle("Power\n(Watt)").setAlignment(Chart.TopLeft2);
            // Set the axis, label and title colors for the primary y axis to red
            // (c00000) to match the first data set
            c.yAxis().setColors(0xcc0000, 0xcc0000, 0xcc0000);

            // Add a title on top of the secondary (right) y axis.
            c.yAxis2().setTitle("Load\n(Mbps)").setAlignment(Chart.TopRight2);
            // Set the axis, label and title colors for the secondary y axis to green
            // (00800000) to match the second data set
            c.yAxis2().setColors(0x008000, 0x008000, 0x008000);

            // Add the third y-axis at 50 pixels to the left of the plot area
            Axis leftAxis = c.addAxis(Chart.Left, 50);

            // Add a title on top of the third y axis.
            leftAxis.setTitle("Temp\n(C)").setAlignment(Chart.TopLeft2);
            // Set the axis, label and title colors for the third y axis to blue
            // (0000cc) to match the third data set
            leftAxis.setColors(0x0000cc, 0x0000cc, 0x0000cc);

            // Add the fouth y-axis at 50 pixels to the right of the plot area
            Axis rightAxis = c.addAxis(Chart.Right, 50);

            // Add a title on top of the fourth y axis.
            rightAxis.setTitle("Error\n(%)").setAlignment(Chart.TopRight2);
            // Set the axis, label and title colors for the fourth y axis to purple
            // (880088) to match the fourth data set
            rightAxis.setColors(0x880088, 0x880088, 0x880088);

            // Add a line layer to for the first data set using red (c00000) color,
            // with a line width of 2 pixels
            LineLayer layer0 = c.addLineLayer(data0, 0xcc0000, "Power");

            layer0.setLineWidth(2);

            // Add a line layer to for the second data set using green (00c0000)
            // color, with a line width of 2 pixels. Bind the layer to the secondary
            // y-axis.
            LineLayer layer1 = c.addLineLayer(data1, 0x008000, "Load");

            layer1.setLineWidth(2);
            layer1.setUseYAxis2();

            // Add a line layer to for the third data set using blue (0000cc) color,
            // with a line width of 2 pixels. Bind the layer to the third y-axis.
            LineLayer layer2 = c.addLineLayer(data2, 0x0000cc, "Temperature");

            layer2.setLineWidth(2);
            layer2.setUseYAxis(leftAxis);

            // Add a line layer to for the fourth data set using purple (880088)
            // color, with a line width of 2 pixels. Bind the layer to the fourth
            // y-axis.
            LineLayer layer3 = c.addLineLayer(data3, 0x880088, "Error Rate");

            layer3.setLineWidth(2);
            layer3.setUseYAxis(rightAxis);

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

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='{dataSetName} at hour {xLabel} = {value}'");
        }
예제 #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 (x, y) data for the first line
            double[] dataX0 = { 20, 90, 40, 30, 12 };
            double[] dataY0 = { 10, 40, 75, 54, 20 };

            // The (x, y) data for the second line
            double[] dataX1 = { 10, 40, 75, 54, 60 };
            double[] dataY1 = { 50, 90, 40, 30, 10 };

            // Create a XYChart object of size 450 x 450 pixels
            XYChart c = new XYChart(450, 450);

            // Set the plotarea at (55, 65) and of size 350 x 300 pixels, with white
            // background and a light grey border (0xc0c0c0). Turn on both horizontal
            // and vertical grid lines with light grey color (0xc0c0c0)
            c.setPlotArea(55, 65, 350, 300, 0xffffff, -1, 0xc0c0c0, 0xc0c0c0, -1);

            // Add a legend box at (50, 30) (top of the chart) with horizontal
            // layout. Use 12 pts Times Bold Italic font. Set the background and
            // border color to Transparent.
            c.addLegend(50, 30, false, "Times New Roman Bold Italic", 12
                        ).setBackground(Chart.Transparent);

            // Add a title to the chart using 18 pts Times Bold Itatic font
            c.addTitle("Reaction Path", "Times New Roman Bold Italic", 18);

            // Add a title to the y axis using 12 pts Arial Bold Italic font
            c.yAxis().setTitle("Temperature (Celcius)", "Arial Bold Italic", 12);

            // Set the y axis line width to 3 pixels
            c.yAxis().setWidth(3);

            // Add a title to the x axis using 12 pts Arial Bold Italic font
            c.xAxis().setTitle("Pressure (Pa)", "Arial Bold Italic", 12);

            // Set the x axis line width to 3 pixels
            c.xAxis().setWidth(3);

            // Add a red (0xff3333) line layer using dataX0 and dataY0
            LineLayer layer1 = c.addLineLayer(dataY0, 0xff3333, "Compound AAA");

            layer1.setXData(dataX0);

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

            // Use 9 pixel square symbols for the data points
            layer1.getDataSet(0).setDataSymbol(Chart.SquareSymbol, 9);

            // Add custom text labels to the first and last point on the scatter plot
            // using Arial Bold font
            layer1.addCustomDataLabel(0, 0, "Start", "Arial Bold");
            layer1.addCustomDataLabel(0, 4, "End", "Arial Bold");

            // Add a green (0x33ff33) line layer using dataX1 and dataY1
            LineLayer layer2 = c.addLineLayer(dataY1, 0x33ff33, "Compound BBB");

            layer2.setXData(dataX1);

            // Set the line width to 3 pixels
            layer2.setLineWidth(3);

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

            // Add custom text labels to the first and last point on the scatter plot
            // using Arial Bold font
            layer2.addCustomDataLabel(0, 0, "Start", "Arial Bold");
            layer2.addCustomDataLabel(0, 4, "End", "Arial Bold");

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

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='[{dataSetName}] Pressure = {x} Pa, Temperature = {value} C'")
            ;
        }
        //
        // Create chart
        //
        private void createChart(RazorChartViewer viewer)
        {
            // The data for the line chart
            double[] data0 = { 50, 55, 47, 36, 42, 49, 63, 62, 73, 59, 56, 50, 64, 60, 67, 67, 58, 59, 73,
                               77, 84, 82, 80, 84 };
            double[] data1 = { 36, 28, 25, 33, 38, 20, 22, 30, 25, 33, 30, 24, 28, 36, 30, 45, 46, 42, 48,
                               45, 43, 52, 64, 70 };

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

            // Create an XYChart object of size 600 x 360 pixels, with a light blue (EEEEFF) background,
            // black border, 1 pxiel 3D border effect and rounded corners
            XYChart c = new XYChart(600, 360, 0xeeeeff, 0x000000, 1);

            c.setRoundedFrame();

            // Set plotarea at (55, 60) with size of 520 x 240 pixels. Use white (ffffff) as background
            // and grey (cccccc) for grid lines
            c.setPlotArea(55, 60, 520, 240, 0xffffff, -1, -1, 0xcccccc, 0xcccccc);

            // Add a legend box at (55, 58) (top of plot area) using 9pt Arial Bold font with horizontal
            // layout Set border and background colors of the legend box to Transparent
            LegendBox legendBox = c.addLegend(55, 58, false, "Arial Bold", 9);

            legendBox.setBackground(Chart.Transparent);

            // Reserve 10% margin at the top of the plot area during auto-scaling to leave space for the
            // legends.
            c.yAxis().setAutoScale(0.1);

            // Add a title to the chart using 15pt Times Bold Italic font. The text is white (ffffff) on
            // a blue (0000cc) background, with glass effect.
            ChartDirector.TextBox title = c.addTitle("Monthly Revenue for Year 2000/2001",
                                                     "Times New Roman Bold Italic", 15, 0xffffff);
            title.setBackground(0x0000cc, 0x000000, Chart.glassEffect(Chart.ReducedGlare));

            // Add a title to the y axis
            c.yAxis().setTitle("Month Revenue (USD millions)");

            // Set the labels on the x axis. Draw the labels vertical (angle = 90)
            c.xAxis().setLabels(labels).setFontAngle(90);

            // Add a vertical mark at x = 17 using a semi-transparent purple (809933ff) color and Arial
            // Bold font. Attached the mark (and therefore its label) to the top x axis.
            Mark mark = c.xAxis2().addMark(17, unchecked ((int)0x809933ff), "Merge with Star Tech",
                                           "Arial Bold");

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

            // Set the mark label font color to purple (0x9933ff)
            mark.setFontColor(0x9933ff);

            // Add a copyright message at (575, 295) (bottom right of plot area) using Arial Bold font
            ChartDirector.TextBox copyRight = c.addText(575, 295, "(c) Copyright Space Travel Ltd",
                                                        "Arial Bold");
            copyRight.setAlignment(Chart.BottomRight);

            // Add a line layer to the chart
            LineLayer layer = c.addLineLayer();

            // Set the default line width to 3 pixels
            layer.setLineWidth(3);

            // Add the data sets to the line layer
            layer.addDataSet(data0, -1, "Enterprise");
            layer.addDataSet(data1, -1, "Consumer");

            // Create the image
            viewer.Image = c.makeWebImage(Chart.PNG);

            // Create an image map for the chart
            string chartImageMap = c.getHTMLImageMap(Url.Action("", "xystub"), "",
                                                     "title='{dataSetName} @ {xLabel} = USD {value|0} millions'");

            // Create an image map for the legend box
            string legendImageMap = legendBox.getHTMLImageMap(
                "javascript:popMsg('the legend key [{dataSetName}]');", " ",
                "title='This legend key is clickable!'");

            // Obtain the image map for the title
            string titleImageMap = "<area " + title.getImageCoor() +
                                   " href='javascript:popMsg(\"the chart title\");' title='The title is clickable!'>";

            // Obtain the image map for the mark
            string markImageMap = "<area " + mark.getImageCoor() +
                                  " href='javascript:popMsg(\"the Merge with Star Tech mark\");' title='The Merge with " +
                                  "Star Tech text is clickable!'>";

            // Obtain the image map for the copyright message
            string copyRightImageMap = "<area " + copyRight.getImageCoor() +
                                       " href='javascript:popMsg(\"the copyright message\");' title='The copyright text is " +
                                       "clickable!'>";

            // Get the combined image map
            viewer.ImageMap = chartImageMap + legendImageMap + titleImageMap + markImageMap +
                              copyRightImageMap;
        }
예제 #14
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 = { 50, 55, 47, 34, 42, 49, 63, 62, 73, 59, 56, 50, 64, 60,
                              67, 67, 58, 59, 73, 77, 84, 82, 80, 84, 89 };

            // The labels for the chart. Note the "-" means a minor tick.
            string[] labels = { "0\nJun 4", "1",  "2",  "3",  "4",  "5",  "6",  "7",  "8",
                                "9",        "10", "11", "12", "13", "14", "15", "16", "17","18","19",
                                "20",       "21", "22", "23", "0\nJun 5" };

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

            // Set the plotarea at (80, 25) and of size 300 x 200 pixels. Use
            // alternate color background (0xeeeeee) and (0xffffff). Set border and
            // grid colors to grey (0xc0c0c0).
            c.setPlotArea(50, 25, 300, 200, 0xeeeeee, 0xffffff, 0xc0c0c0, 0xc0c0c0,
                          0xc0c0c0);

            // Add a title to the chart using 14 pts Times Bold Italic font
            c.addTitle("Server Monitor", "Times New Roman Bold Italic", 14);

            // Add a title to the y axis
            c.yAxis().setTitle("Server Load (MBytes)");

            // Set the y axis width to 2 pixels
            c.yAxis().setWidth(2);

            // Set the labels on the x axis.
            c.xAxis().setLabels(labels);

            // Display 1 out of 3 labels on the x-axis. Show minor ticks for
            // remaining labels.
            c.xAxis().setLabelStep(3, 1);

            // Set the x axis width to 2 pixels
            c.xAxis().setWidth(2);

            // Add a horizontal red (0x800080) mark line at y = 80
            Mark yMark = c.yAxis().addMark(80, 0xff0000,
                                           "Critical Threshold Set Point");

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

            // Put the mark label at the top center of the mark line
            yMark.setAlignment(Chart.TopCenter);

            // Add an orange (0xffcc66) zone from x = 18 to x = 20
            c.xAxis().addZone(18, 20, 0xffcc66);

            // Add a vertical brown (0x995500) mark line at x = 18
            Mark xMark1 = c.xAxis().addMark(18, 0x995500, "Backup Start");

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

            // Put the mark label at the left of the mark line
            xMark1.setAlignment(Chart.Left);

            // Rotate the mark label by 90 degrees so it draws vertically
            xMark1.setFontAngle(90);

            // Add a vertical brown (0x995500) mark line at x = 20
            Mark xMark2 = c.xAxis().addMark(20, 0x995500, "Backup End");

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

            // Put the mark label at the right of the mark line
            xMark2.setAlignment(Chart.Right);

            // Rotate the mark label by 90 degrees so it draws vertically
            xMark2.setFontAngle(90);

            // Add a green (0x00cc00) line layer with line width of 2 pixels
            c.addLineLayer(data, 0x00cc00).setLineWidth(2);

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

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='Load at {x}:00 = {value} MBytes'");
        }
예제 #15
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 line chart
            double[] data0 = { 70, 73, 80, 90, 95, 93, 82, 77, 82, 101, 111, 115 };
            double[] data1 = { 90, 96, 89, 77, 82, 96, 109, 109, 99, 108, 96, 91 };
            double[] data2 = { 58, 34, 25, 49, 64, 10, 16, 40, 25, 49, 40, 22 };

            // The labels for the line chart
            string[] labels = { "2008-01", "2008-02", "2008-03", "2008-04", "2008-05", "2008-06",
                                "2008-07", "2008-08", "2008-09", "2008-10", "2008-11", "2008-12" };

            // Create a XYChart object of size 450 x 450 pixels
            XYChart c = new XYChart(450, 450);

            // Add a title to the chart using 15pt Arial Italic font.
            ChartDirector.TextBox title = c.addTitle("Inter-line Coloring", "Arial Italic", 15);

            // Add a legend box where the top-center is anchored to the horizontal center of the
            // chart, just under the title. Use horizontal layout and 10 points Arial Bold font, and
            // transparent background and border. Use line style legend key.
            LegendBox legendBox = c.addLegend(c.getWidth() / 2, title.getHeight(), false,
                                              "Arial Bold Italic", 10);

            legendBox.setBackground(Chart.Transparent, Chart.Transparent);
            legendBox.setAlignment(Chart.TopCenter);
            legendBox.setLineStyleKey();

            // Tentatively set the plotarea at (70, 65) and of (chart_width - 100) x (chart_height -
            // 110) in size. Use light grey (c0c0c0) border and horizontal and vertical grid lines.
            PlotArea plotArea = c.setPlotArea(70, 65, c.getWidth() - 100, c.getHeight() - 110, -1,
                                              -1, 0xc0c0c0, 0xc0c0c0, -1);

            // Add a title to the y axis using 12pt Arial Bold Italic font
            c.yAxis().setTitle("Axis Title Placeholder", "Arial Bold Italic", 12);

            // Add a title to the x axis using 12pt Arial Bold Italic font
            c.xAxis().setTitle("Axis Title Placeholder", "Arial Bold Italic", 12);

            // Set the axes line width to 3 pixels
            c.xAxis().setWidth(3);
            c.yAxis().setWidth(3);

            // Set the labels on the x axis.
            c.xAxis().setLabels(labels);

            // Use 8 points Arial rotated by 90 degrees as the x-axis label font
            c.xAxis().setLabelStyle("Arial", 8, Chart.TextColor, 90);

            // Add a spline curve to the chart
            SplineLayer layer0 = c.addSplineLayer(data0, 0xff0000, "Data Set 0");

            layer0.setLineWidth(2);

            // Add a normal line to the chart
            LineLayer layer1 = c.addLineLayer(data1, 0x008800, "Data Set 1");

            layer1.setLineWidth(2);

            // Color the region between the above spline curve and normal line. Use the
            // semi-transparent red (80ff000000) if the spline curve is higher than the normal line,
            // otherwise use semi-transparent green (80008800)
            c.addInterLineLayer(layer0.getLine(), layer1.getLine(), unchecked ((int)0x80ff0000),
                                unchecked ((int)0x80008800));

            // Add another normal line to the chart
            LineLayer layer2 = c.addLineLayer(data2, 0x0000ff, "Data Set 2");

            layer2.setLineWidth(2);

            // Add a horizontal mark line to the chart at y = 40
            Mark mark = c.yAxis().addMark(40, -1, "Threshold");

            mark.setLineWidth(2);

            // Set the mark line to purple (880088) dash line. Use white (ffffff) for the mark
            // label.
            mark.setMarkColor(c.dashLineColor(0x880088), 0xffffff);

            // Put the mark label at the left side of the mark, with a purple (880088) background.
            mark.setAlignment(Chart.Left);
            mark.setBackground(0x880088);

            // Color the region between the above normal line and mark line. Use the
            // semi-transparent blue (800000ff) if the normal line is higher than the mark line,
            // otherwise use semi-transparent purple (80880088)
            c.addInterLineLayer(layer2.getLine(), mark.getLine(), unchecked ((int)0x800000ff),
                                unchecked ((int)0x80880088));

            // Layout the legend box, so we can get its height
            c.layoutLegend();

            // Adjust the plot area size, such that the bounding box (inclusive of axes) is 10
            // pixels from the left edge, just under the legend box, 25 pixels from the right edge,
            // and 10 pixels from the bottom edge.
            c.packPlotArea(10, legendBox.getTopY() + legendBox.getHeight(), c.getWidth() - 25,
                           c.getHeight() - 10);

            // After determining the exact plot area position, we may adjust the legend box and the
            // title positions so that they are centered relative to the plot area (instead of the
            // chart)
            legendBox.setPos(plotArea.getLeftX() + (plotArea.getWidth() - legendBox.getWidth()) / 2,
                             legendBox.getTopY());
            title.setPos(plotArea.getLeftX() + (plotArea.getWidth() - title.getWidth()) / 2,
                         title.getTopY());

            // Output the chart
            viewer.Chart = c;

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='{dataSetName} in {xLabel}: {value}'");
        }
예제 #16
0
    private void SetYearlyGraph()
    {
        int yearFrom = Convert.ToInt32((txtYearFrom.Text.Trim() == "" ? "0" : txtYearFrom.Text.Trim())) - 543;
        int yearTo = Convert.ToInt32((txtYearTo.Text.Trim() == "" ? "0" : txtYearTo.Text.Trim())) - 543;
        if (yearFrom < 0)
            yearFrom = 0;
        if (yearTo < 0)
            yearTo = 0;
        int tmp = yearFrom;
        if (yearFrom > yearTo)
        {
            yearFrom = yearTo;
            yearTo = tmp;
        }
        yearFrom += 543;
        yearTo += 543;

        string[] labels = { "�.�.", "�.�.", "��.�.", "��.�.", "�.�.", "��.�.", "�.�.", "�.�.", "�.�.", "�.�.", "�.�.", "�.�." };

        XYChart c = new XYChart(750, 380, 15663086, 14540253, 0);
        string title = GetTitle() + (yearFrom == yearTo ? "㹻� �.�. " + yearFrom.ToString() : " ������ �.�. " + yearFrom.ToString() + "-" + yearTo.ToString());
        c.addTitle(title, "Tahoma Bold", 12);

        c.setPlotArea(70, 80, 640, 230, c.gradientColor(0, 60, 0, 350, 16777215, 11189196), -1, Chart.Transparent, 1111);

        c.addLegend(30, 25, false, "Tahoma Bold", 8).setBackground(Chart.Transparent);
        c.xAxis().setLabels(labels);
        c.yAxis().setTickDensity(30);
        c.xAxis().setLabelStyle("Tahoma", 8, 001122, 90);
        c.yAxis().setLabelStyle("Tahoma", 8);
        c.yAxis().setLabelFormat("{value|0,}");
        c.xAxis().setWidth(2);
        c.yAxis().setWidth(2);
        c.yAxis().setTitle("�ӹǹ", "Tahoma Bold", 10);
        c.xAxis().setTitle("��͹", "Tahoma Bold", 10);

        LineLayer layer = c.addLineLayer();
        layer.setLineWidth(1);
        AddData(layer, yearFrom - 543, yearTo - 543);
        vwChart.Image = c.makeWebImage(Chart.PNG);
    }
예제 #17
0
        //
        // Create chart
        //
        private void createChart(RazorChartViewer viewer)
        {
            //
            //    We use a random number generator to simulate the data from 9:30am to 4:30pm with one
            //    data point every 4 minutes. The total number of points during that period is 106.  (7
            //    hours x 15 points/hour + 1)
            //
            int noOfPoints = 106;

            // Assume we have not reached the end of the day yet, and only 85 points are available.
            // Create a random table object of 1 col x 85 rows, using 9 as seed.
            RanTable rantable = new RanTable(9, 1, 85);

            // Set the 1st column to start with 1800 and with random delta from -5 to 5.
            rantable.setCol(0, 1800, -5, 5);

            // Get the data as the 1st column of the random table
            double[] data = rantable.getCol(0);

            // The x-axis labels for the chart
            string[] labels = { "-",   "10am", "-", " ", "-", "12am", "-", " ", "-", "2pm", "-", " ", "-",
                                "4pm", "-" };

            //
            //    Now we obtain the data into arrays, we can start to draw the chart using ChartDirector
            //

            // Create a XYChart object of size 180 x 180 pixels with a blue background (0x9c9cce)
            XYChart c = new XYChart(180, 180, 0x9c9cce);

            // Add titles to the top and bottom of the chart using 7.5pt Arial font. The text is white
            // 0xffffff on a deep blue 0x31319C background.
            c.addTitle2(Chart.Top, "STAR TECH INDEX  2003-01-28", "Arial", 7.5, 0xffffff, 0x31319c);
            c.addTitle2(Chart.Bottom, "LATEST  STI:1809.41 (+14.51)", "Arial", 7.5, 0xffffff, 0x31319c);

            // Set the plotarea at (31, 21) and of size 145 x 124 pixels, with a pale yellow (0xffffc8)
            // background.
            c.setPlotArea(31, 21, 145, 124, 0xffffc8);

            // Add custom text at (176, 21) (top right corner of plotarea) using 11pt Times Bold Italic
            // font/red (0xc09090) color
            c.addText(176, 21, "Chart Demo", "Times New Roman Bold Italic", 11, 0xc09090).setAlignment(
                Chart.TopRight);

            // Use 7.5pt Arial as the y axis label font
            c.yAxis().setLabelStyle("", 7.5);

            // Set the labels on the x axis by spreading the labels evenly between the first point (index
            // = 0) and the last point (index = noOfPoints - 1)
            c.xAxis().setLinearScale(0, noOfPoints - 1, labels);

            // Use 7.5pt Arial as the x axis label font
            c.xAxis().setLabelStyle("", 7.5);

            // Add a deep blue (0x000080) line layer to the chart
            c.addLineLayer(data, 0x000080);

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

            // Include tool tip for the chart. The chart starts at 9:30am and each point spans 240
            // seconds, so we can compute the time as {x}*240+9.5*3600.
            viewer.ImageMap = c.getHTMLImageMap("", "", "title='{={x}*240+9.5*3600|h:nna}: {value|2}'");
        }
예제 #18
0
        protected void Generate_Forecast(int productid)
        {
            Product info = ControllerManager.Product.GetById(productid);
            IList <TransactionHistoryWeekly> history = ControllerManager.TransactionHistoryWeekly.GetInfo(info.Id, Config.CurrentWeek, Config.CurrentDate.Year, 1);

            this.Label12.Text = info.ProductCode.ToString();
            this.Label3.Text  = info.Description.ToString();
            this.Label5.Text  = info.Provider.Name;
            this.Label7.Text  = (history[0].Stock + history[0].Purchase - history[0].Sale).ToString();
            this.Label9.Text  = info.RepositionLevel.ToString();
            this.Label11.Text = info.RepositionPoint.ToString();
            this.Label16.Text = info.LeadTime.ToString();
            this.Label1.Text  = info.Safety.ToString();

            IList <Forecast> forecast = ControllerManager.Forecast.GetForecast(info, Config.CurrentWeek, Config.CurrentDate.Year);

            this.GridView1.DataSource = forecast;
            this.GridView1.DataBind();

            //------GRAFICO-------------------------------------------
            if (forecast.Count > 0)
            {
                string[] Titulos = new string[forecast.Count];
                double[] Stock   = new double[forecast.Count];
                double[] Ventas  = new double[forecast.Count];
                double[] Compras = new double[forecast.Count];
                for (int cont = 0; cont < forecast.Count; cont++)
                {
                    Stock.SetValue(forecast[cont].FinalStock, cont);
                    Ventas.SetValue(forecast[cont].Sale, cont);
                    Compras.SetValue(forecast[cont].Purchase, cont);
                    Titulos.SetValue(forecast[cont].Week.ToString(), cont);
                }

                XYChart c = new XYChart(480, 300, 0xeeeeff, 0x000000, 3);
                c.setPlotArea(50, 70, 410, 180, 0xffffff, -1, -1, 0xcccccc, 0xcccccc);
                c.addLegend(50, 50, false, "Arial Bold", 8).setBackground(Chart.Transparent);
                c.addTitle("Graficos Estadisticos", "Verdana Bold", 12).setBackground(0xccccff, 0x000000, Chart.glassEffect());
                c.xAxis().setTitle("Semanas");
                c.yAxis().setTitle("Cantidad");

                Mark actual = c.xAxis().addMark(10, 0x000000, "SEMANA ACTUAL");
                actual.setLineWidth(1);
                actual.setAlignment(Chart.TopRight);
                actual.setFontAngle(90);
                Mark actual0 = c.xAxis().addMark(10 + info.LeadTime, 0x000000, "LEADTIME");
                actual0.setLineWidth(1);
                actual0.setAlignment(Chart.TopLeft);
                actual0.setFontAngle(90);
                LineLayer linea = c.addLineLayer();
                linea.setLineWidth(3);
                linea.addDataSet(Stock, 0x000000, "Stock Final");
                linea.addDataSet(Ventas, 0x00ff00, "Ventas");
                linea.addDataSet(Compras, 0x0000FF, "Compras");
                c.addAreaLayer(Stock, c.yZoneColor(forecast[10].Safety, unchecked ((int)0x50ff3c3c), unchecked ((int)0x500080c0)));
                c.xAxis().addZone(10, 10 + info.LeadTime, 0xdcdcdc);
                c.xAxis().setLabels(Titulos);
                c.xAxis().setLabelStep(2);
                WebChartViewer1.Image    = c.makeWebImage(Chart.PNG);
                WebChartViewer1.ImageMap = c.getHTMLImageMap("", "", "title='Semana {xLabel}: {value}'");
                WebChartViewer1.Visible  = true;
            }
        }
예제 #19
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)
        {
            // The data for the line chart
            double[] data = { 50, 55, 47, 34, 42, 49, 63, 62, 73, 59, 56, 50, 64, 60, 67, 67, 58, 59,
                              73, 77, 84, 82, 80, 91 };

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

            // Create a XYChart object of size 500 x 320 pixels, with a pale purpule (0xffccff)
            // background, a black border, and 1 pixel 3D border effect.
            XYChart c = new XYChart(500, 320, 0xffccff, 0x000000, 1);

            // Set the plotarea at (55, 45) and of size 420 x 210 pixels, with white background.
            // Turn on both horizontal and vertical grid lines with light grey color (0xc0c0c0)
            c.setPlotArea(55, 45, 420, 210, 0xffffff, -1, -1, 0xc0c0c0, -1);

            // Add a legend box at (55, 25) (top of the chart) with horizontal layout. Use 8pt Arial
            // font. Set the background and border color to Transparent.
            c.addLegend(55, 22, false, "", 8).setBackground(Chart.Transparent);

            // Add a title box to the chart using 13pt Times Bold Italic font. The text is white
            // (0xffffff) on a purple (0x800080) background, with a 1 pixel 3D border.
            c.addTitle("Long Term Server Load", "Times New Roman Bold Italic", 13, 0xffffff
                       ).setBackground(0x800080, -1, 1);

            // Add a title to the y axis
            c.yAxis().setTitle("MBytes");

            // Set the labels on the x axis. Rotate the font by 90 degrees.
            c.xAxis().setLabels(labels).setFontAngle(90);

            // Add a line layer to the chart
            LineLayer lineLayer = c.addLineLayer();

            // Add the data to the line layer using light brown color (0xcc9966) with a 7 pixel
            // square symbol
            lineLayer.addDataSet(data, 0xcc9966, "Server Utilization").setDataSymbol(
                Chart.SquareSymbol, 7);

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

            // tool tip for the line layer
            lineLayer.setHTMLImageMap("", "", "title='{xLabel}: {value} MBytes'");

            // Add a trend line layer using the same data with a dark green (0x008000) color. Set
            // the line width to 2 pixels
            TrendLayer trendLayer = c.addTrendLayer(data, 0x008000, "Trend Line");

            trendLayer.setLineWidth(2);

            // tool tip for the trend layer
            trendLayer.setHTMLImageMap("", "", "title='Change rate: {slope|2} MBytes/per month'");

            // Output the chart
            viewer.Chart = c;

            // include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable");
        }
예제 #20
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 age groups
            string[] labels = { "0 - 4",   "5 - 9",   "10 - 14", "15 - 19", "20 - 24",
                                "24 - 29", "30 - 34", "35 - 39", "40 - 44", "44 - 49","50 - 54",
                                "55 - 59", "60 - 64", "65 - 69", "70 - 74", "75 - 79","80+" };

            // The male population (in thousands)
            double[] male = { 215, 238, 225, 236, 235, 260, 286, 340, 363, 305, 259,
                              164, 135, 127, 102,  68, 66 };

            // The female population (in thousands)
            double[] female = { 194, 203, 201, 220, 228, 271, 339, 401, 384, 304, 236,
                                137, 116, 122, 112,  85, 110 };


            //=============================================================
            //    Draw the right bar chart
            //=============================================================

            // Create a XYChart object of size 320 x 300 pixels
            XYChart c = new XYChart(320, 300);

            // Set the plotarea at (50, 0) and of size 250 x 255 pixels. Use pink
            // (0xffdddd) as the background.
            c.setPlotArea(50, 0, 250, 255, 0xffdddd);

            // Add a custom text label at the top right corner of the right bar chart
            c.addText(300, 0, "Female", "Times New Roman Bold Italic", 12, 0xa07070
                      ).setAlignment(Chart.TopRight);

            // Add the pink (0xf0c0c0) bar chart layer using the female data
            BarLayer femaleLayer = c.addBarLayer(female, 0xf0c0c0, "Female");

            // Swap the axis so that the bars are drawn horizontally
            c.swapXY(true);

            // Set the bar to touch each others
            femaleLayer.setBarGap(Chart.TouchBar);

            // Set the border style of the bars to 1 pixel 3D border
            femaleLayer.setBorderColor(-1, 1);

            // Add a Transparent line layer to the chart using the male data. As it
            // is Transparent, only the female bar chart can be seen. We need to put
            // both male and female data in both left and right charts, because we
            // want auto-scaling to produce the same scale for both chart.
            c.addLineLayer(male, Chart.Transparent);

            // Set the y axis label font to Arial Bold
            c.yAxis().setLabelStyle("Arial Bold");

            // Set the labels between the two bar charts, which can be considered as
            // the x-axis labels for the right chart
            ChartDirector.TextBox tb = c.xAxis().setLabels(labels);

            // Use a fix width of 50 for the labels (height = automatic) with center
            // alignment
            tb.setSize(50, 0);
            tb.setAlignment(Chart.Center);

            // Set the label font to Arial Bold
            tb.setFontStyle("Arial Bold");

            // Disable ticks on the x-axis by setting the tick length to 0
            c.xAxis().setTickLength(0);

            //=============================================================
            //    Draw the left bar chart
            //=============================================================

            // Create a XYChart object of size 280 x 300 pixels with a transparent
            // background.
            XYChart c2 = new XYChart(280, 300, Chart.Transparent);

            // Set the plotarea at (20, 0) and of size 250 x 255 pixels. Use pale
            // blue (0xddddff) as the background.
            c2.setPlotArea(20, 0, 250, 255, 0xddddff);

            // Add a custom text label at the top left corner of the left bar chart
            c2.addText(20, 0, "Male", "Times New Roman Bold Italic", 12, 0x7070a0);

            // Add the pale blue (0xaaaaff) bar chart layer using the male data
            BarLayer maleLayer = c2.addBarLayer(male, 0xaaaaff, "Male");

            // Swap the axis so that the bars are drawn horizontally
            c2.swapXY(true);

            // Reverse the direction of the y-axis so it runs from right to left
            c2.yAxis().setReverse();

            // Set the bar to touch each others
            maleLayer.setBarGap(Chart.TouchBar);

            // Set the border style of the bars to 1 pixel 3D border
            maleLayer.setBorderColor(-1, 1);

            // Add a Transparent line layer to the chart using the female data. As it
            // is Transparent, only the male bar chart can be seen. We need to put
            // both male and female data in both left and right charts, because we
            // want auto-scaling to produce the same scale for both chart.
            c2.addLineLayer(female, Chart.Transparent);

            // Set the y axis label font to Arial Bold
            c2.yAxis().setLabelStyle("Arial Bold");

            // Set the x-axis labels for tool tip purposes.
            c2.xAxis().setLabels(labels);

            // Hide the x-axis labels by setting them to Transparent. We only need to
            // display the x-axis labels for the right chart.
            c2.xAxis().setColors(0x000000, Chart.Transparent, -1, Chart.Transparent);

            //=============================================================
            //    Use a MultiChart to contain both bar charts
            //=============================================================

            // Create a MultiChart object of size 590 x 320 pixels.
            MultiChart m = new MultiChart(590, 320);

            // Add a title to the chart using Arial Bold Italic font
            m.addTitle("Demographics Hong Kong Year 2002", "Arial Bold Italic");

            // Add another title at the bottom using Arial Bold Italic font
            m.addTitle2(Chart.Bottom, "Population (in thousands)",
                        "Arial Bold Italic", 10);

            // Put the right chart at (270, 25)
            m.addChart(270, 25, c);

            // Put the left chart at (0, 25)
            m.addChart(0, 25, c2);

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

            //include tool tip for the chart
            viewer.ImageMap = m.getHTMLImageMap("clickable", "",
                                                "title='{dataSetName} (Age {xLabel}): Population {value}K'");
        }
예제 #21
0
        //
        // Create chart
        //
        private void createChart(RazorChartViewer viewer)
        {
            // In this example, we simply use random data for the 2 data series.
            RanSeries r = new RanSeries(127);

            double[]   data0      = r.getSeries(180, 70, -5, 5);
            double[]   data1      = r.getSeries(180, 150, -15, 15);
            DateTime[] timeStamps = r.getDateSeries(180, new DateTime(2014, 3, 1), 86400);

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

            // Add a title to the chart using 20pt Arial font
            c.addTitle("    Plasma Stabilizer Energy Usage", "Arial", 20);

            // Set the plotarea at (55, 60) and of size 560 x 330 pixels, with transparent background and
            // border and light grey (0xcccccc) horizontal grid lines
            c.setPlotArea(55, 60, 560, 330, -1, -1, Chart.Transparent, 0xcccccc);

            // Add a legend box at (55, 30) using horizontal layout, with 10pt Arial Bold as font and
            // transparent background and border.
            c.addLegend(55, 30, false, "Arial Bold", 10).setBackground(Chart.Transparent);

            // Set axis label style to 10pt Arial
            c.xAxis().setLabelStyle("Arial", 10);
            c.yAxis().setLabelStyle("Arial", 10);

            // Set the x and y axis stems to transparent, and the x-axis tick color to grey (0xcccccc)
            c.xAxis().setColors(Chart.Transparent, Chart.TextColor, Chart.TextColor, 0xcccccc);
            c.yAxis().setColors(Chart.Transparent);

            // Configure the x-axis tick lengtht to 10 pixels internal to the plot area
            c.xAxis().setTickLength(-10, 0);

            // With the ticks internal to the plot area, the x-axis labels will come very close to the
            // axis stem, so we configure a wider gap.
            c.xAxis().setLabelGap(10);

            // For the automatic axis labels, set the minimum spacing to 80/40 pixels for the x/y axis.
            c.xAxis().setTickDensity(80);
            c.yAxis().setTickDensity(40);

            // Use "mm/yyyy" as the x-axis label format for the first plotted month of a year, and "mm"
            // for other months
            c.xAxis().setMultiFormat(Chart.StartOfYearFilter(), "{value|mm/yyyy} ",
                                     Chart.StartOfMonthFilter(), "{value|mm}");

            // Add a title to the y axis using dark grey (0x555555) 12pt Arial Bold font
            c.yAxis().setTitle("Energy (kWh)", "Arial Bold", 14, 0x555555);

            // Add a line layer with 2-pixel line width
            LineLayer layer0 = c.addLineLayer(data0, 0xcc0000, "Power Usage");

            layer0.setXData(timeStamps);
            layer0.setLineWidth(2);

            // Add an area layer using semi-transparent blue (0x7f0044cc) as the fill color
            AreaLayer layer1 = c.addAreaLayer(data1, 0x7f0044cc, "Effective Load");

            layer1.setXData(timeStamps);
            layer1.setBorderColor(Chart.SameAsMainColor);

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

            // Output Javascript chart model to the browser to suppport tracking cursor
            viewer.ChartModel = c.getJsChartModel();
        }
예제 #22
0
    private void SetMonthlyProductGraph()
    {
        int yearFrom = Convert.ToInt32(Request["yearfrom"]);
        int yearTo = Convert.ToInt32(Request["yearto"]);
        int currentYear = Convert.ToInt32(Request["currentyear"]);
        //int yearFrom = 2551;
        //int yearTo = 2551;
        //int currentYear = 2551;
        this.lnkYear.Text = GetReportTitle() + (yearFrom == yearTo ? "ã¹»Õ ¾.È. " + yearFrom.ToString() : " µÑé§áµè»Õ ¾.È. " + yearFrom.ToString() + "-" + yearTo.ToString());
        this.lblMonth.Text = ">> »Õ ¾.È. " + currentYear.ToString();
        this.pnlMonth.Visible = true;
        string[] labels = { "Á.¤.", "¡.¾.", "ÁÕ.¤.", "àÁ.Â.", "¾.¤.", "ÁÔ.Â.", "¡.¤.", "Ê.¤.", "¡.Â.", "µ.¤.", "¾.Â.", "¸.¤." };
        XYChart c = new XYChart(750, 380, 15663086, 14540253, 0);
        string title = GetReportTitle() + "ã¹»Õ ¾.È. " + currentYear.ToString();

        c.addTitle(title, "Tahoma Bold", 12);
        c.setPlotArea(70, 80, 640, 230, c.gradientColor(0, 60, 0, 350, 16777215, 11189196), -1, Chart.Transparent, 1111);
        c.addLegend(30, 25, false, "Tahoma Bold", 8).setBackground(Chart.Transparent); 
        c.xAxis().setLabels(labels);
        c.yAxis().setTickDensity(30);
        c.xAxis().setLabelStyle("Tahoma", 8, 001122, 90);
        c.yAxis().setLabelStyle("Tahoma", 8);
        c.yAxis().setLabelFormat("{value|0,}");
        c.xAxis().setWidth(2);
        c.yAxis().setWidth(2);
        c.yAxis().setTitle("ÃÒ¤Ò", "Tahoma Bold", 10);
        c.xAxis().setTitle("à´×͹", "Tahoma Bold", 10);

        LineLayer layer = c.addLineLayer();
        layer.setLineWidth(1);
        AddData(layer, currentYear - 543);
        vwChart.Image = c.makeWebImage(Chart.PNG);
        vwChart.ImageMap = c.getHTMLImageMap("", "", "title='{dataSetName} ã¹à´×͹ {xLabel}\r\n{value|,} ÃÒ¡Òà ({percent}%)'");
        this.pnlChart.Visible = true;
    }
예제 #23
0
        /// <summary>
        /// 绘制噪声数据比较分析图
        /// </summary>
        private void CreateChart(int line)
        {
            if (sRecorder == null)
            {
                return;
            }

            XYChart c = new XYChart(700, 360);

            c.setBackground(c.linearGradientColor(0, 0, 0, 100, 0x99ccff, 0xffffff), 0x888888);

            ChartDirector.TextBox title = c.addTitle("噪声数据比较分析图", "Arial Bold", 13);
            title.setPos(0, 20);

            c.setPlotArea(80, 80, 580, 230, 0xffffff, -1, -1, c.dashLineColor(
                              0xaaaaaa, Chart.DotLine), -1);

            LegendBox legendBox = c.addLegend(350, 80, false, "Arial", 8);

            legendBox.setAlignment(Chart.BottomCenter);
            legendBox.setBackground(Chart.Transparent, Chart.Transparent);
            legendBox.setLineStyleKey();
            legendBox.setFontSize(8);

            c.xAxis().setIndent(true);
            c.xAxis().setTitle("噪声频率(Hz)");


            c.yAxis().setTitle("噪声幅度(%)");


            LineLayer layer1;

            ChartDirector.DataSet ds;
            double[] dataSet;
            double[] da;

            dataSet = sRecorder.Data.Amplitude.Skip(4).ToArray();
            da      = sRecorder.Data.Frequency.Skip(4).ToArray();
            switch (line)
            {
            case 0:
                layer1 = c.addLineLayer();
                ds     = layer1.addDataSet(dataSet, GetRandomColor(0), "记录仪" + sRecorder.ID);
                layer1.setLineWidth(2);
                layer1.setXData(da);
                break;

            case 1:
                layer1 = c.addSplineLayer();
                ds     = layer1.addDataSet(dataSet, GetRandomColor(0), "记录仪" + sRecorder.ID);
                layer1.setLineWidth(2);
                layer1.setXData(da);
                break;
            }

            if (eRecorder != null && sRecorder.ID != eRecorder.ID)
            {
                dataSet = eRecorder.Data.Amplitude.Skip(4).ToArray();
                da      = eRecorder.Data.Frequency.Skip(4).ToArray();
                switch (line)
                {
                case 0:
                    layer1 = c.addLineLayer();
                    ds     = layer1.addDataSet(dataSet, GetRandomColor(1), "记录仪" + eRecorder.ID);
                    layer1.setLineWidth(2);
                    layer1.setXData(da);
                    break;

                case 1:
                    layer1 = c.addSplineLayer();
                    ds     = layer1.addDataSet(dataSet, GetRandomColor(1), "记录仪" + eRecorder.ID);
                    layer1.setLineWidth(2);
                    layer1.setXData(da);
                    break;
                }
            }

            c.xAxis().setLabelStep(15);
            c.yAxis().setDateScale(0, 120);

            winChartViewer1.Chart    = c;
            winChartViewer1.ImageMap = c.getHTMLImageMap("clickable", "",
                                                         "title='噪声频率: {x}Hz, \n{dataSetName}: {value}%'");
        }
예제 #24
0
        //
        // Create chart
        //
        private void createChart(RazorChartViewer viewer)
        {
            // Get the selected year.
            string selectedYear = Request["xLabel"];

            //
            // In real life, the data may come from a database based on selectedYear. In this example, we
            // just use a random number generator.
            //
            int      seed     = 50 + (int.Parse(selectedYear) - 1996) * 15;
            RanTable rantable = new RanTable(seed, 1, 12);

            rantable.setCol2(0, seed, -seed * 0.25, seed * 0.33, seed * 0.1, seed * 3);

            double[] data = rantable.getCol(0);

            //
            // Now we obtain the data into arrays, we can start to draw the chart using ChartDirector
            //

            // Create a XYChart object of size 600 x 320 pixels
            XYChart c = new XYChart(600, 360);

            // Add a title to the chart using 18pt Times Bold Italic font
            c.addTitle("Month Revenue for Star Tech for " + selectedYear, "Times New Roman Bold Italic",
                       18);

            // Set the plotarea at (60, 40) and of size 500 x 280 pixels. Use a vertical gradient color
            // from light blue (eeeeff) to deep blue (0000cc) as background. Set border and grid lines to
            // white (ffffff).
            c.setPlotArea(60, 40, 500, 280, c.linearGradientColor(60, 40, 60, 280, 0xeeeeff, 0x0000cc),
                          -1, 0xffffff, 0xffffff);

            // Add a red line (ff0000) chart layer using the data
            ChartDirector.DataSet dataSet = c.addLineLayer().addDataSet(data, 0xff0000, "Revenue");

            // Set the line width to 3 pixels
            dataSet.setLineWidth(3);

            // Use a 13 point circle symbol to plot the data points
            dataSet.setDataSymbol(Chart.CircleSymbol, 13);

            // Set the labels on the x axis. In this example, the labels must be Jan - Dec.
            string[] labels = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct",
                                "Nov", "Dec" };
            c.xAxis().setLabels(labels);

            // When auto-scaling, use tick spacing of 40 pixels as a guideline
            c.yAxis().setTickDensity(40);

            // Add a title to the x axis to reflect the selected year
            c.xAxis().setTitle("Year " + selectedYear, "Times New Roman Bold Italic", 12);

            // Add a title to the y axis
            c.yAxis().setTitle("USD (millions)", "Times New Roman Bold Italic", 12);

            // Set axis label style to 8pt Arial Bold
            c.xAxis().setLabelStyle("Arial Bold", 8);
            c.yAxis().setLabelStyle("Arial Bold", 8);

            // Set axis line width to 2 pixels
            c.xAxis().setWidth(2);
            c.yAxis().setWidth(2);

            // Create the image and save it in a temporary location
            viewer.Image = c.makeWebImage(Chart.PNG);

            // Create an image map for the chart
            viewer.ImageMap = c.getHTMLImageMap(Url.Action("", "clickpie", new { year = selectedYear }),
                                                "", "title='{xLabel}: US$ {value|0}M'");
        }
        private void createChart()
        {
            string[] xLabels = null;
            if (lst_data.Count != 0)
            {
                xLabels = new string[lst_data.Count];

                for (int i = 0; i < xLabels.Length; i++)
                {
                    xLabels[i] = (i + 1).ToString();
                }
            }

            XYChart chart = new XYChart(795, 455);//(857, 448);

            chart.setBackground(chart.linearGradientColor(0, 0, 0, 100, 0x99ccff, 0xffffff), 0x888888);

            ChartDirector.TextBox title1_txt = chart.addTitle("能量强度变化分析", "Arial Bold", 13);
            title1_txt.setPos(0, 20);

            chart.setPlotArea(50, 60, 620, 340, 0xffffff, -1, -1, chart.dashLineColor(Chart.CColor(Color.AliceBlue), Chart.DotLine), -1);
            chart.xAxis().setLabels(xLabels);
            chart.xAxis().setLabelStep(1);
            chart.xAxis().setIndent(true);
            chart.xAxis().setTitle("点数");

            chart.yAxis().setTitle("噪声强度");

            LineLayer layer;

            layer = chart.addLineLayer();
            layer.addDataSet(lst_data.ToArray(), Chart.CColor(Color.Green), "噪声强度");
            layer.setLineWidth(2);
            layer.setFastLineMode(true);

            layer = chart.addLineLayer();
            layer.addDataSet(lst_stdev.ToArray(), Chart.CColor(Color.DarkViolet), "绝对差");
            layer.setLineWidth(2);
            layer.setFastLineMode(true);

            //标准平均值
            Mark standAMPmark = chart.yAxis().addMark(Standard_average, Chart.CColor(Color.Crimson), "", "Arial Bold");

            standAMPmark.setLineWidth(2);
            standAMPmark.setPos(-15, 10);
            standAMPmark.setFontAngle(90);

            //静态漏水标准幅度值
            Mark standAVmark = chart.yAxis().addMark(StandardAMP, Chart.CColor(Color.Cyan), "", "Arial Bold");

            standAVmark.setLineWidth(2);
            standAVmark.setPos(-15, 10);
            standAVmark.setFontAngle(90);

            Mark energymark = chart.yAxis().addMark(energyvalue, Chart.CColor(Color.Chartreuse), "", "Arial Bold");

            LegendBox legendbox = chart.addLegend(672, 60);

            legendbox.addKey("标准平均值", Chart.CColor(Color.Crimson));
            legendbox.addKey("静态漏水标准", Chart.CColor(Color.Cyan));
            legendbox.addKey("能量强度", Chart.CColor(Color.Chartreuse));
            //legendbox.addKey("噪声强度", Chart.CColor(Color.Green));
            //legendbox.addKey("绝对差", Chart.CColor(Color.DarkViolet));

            chart.layout();

            winChartViewer1.Chart    = chart;
            winChartViewer1.ImageMap =
                winChartViewer1.Chart.getHTMLImageMap("clickable", "", "title='点数: {xLabel},强度: {value}'");
        }
예제 #26
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 = { 42, 49, 33, 38, 51, 46, 29, 41, 44, 57, 59, 52, 37, 34, 51, 56, 56,
                               60, 70, 76, 63, 67, 75, 64, 51 };
            double[] data1 = { 50, 55, 47, 34, 42, 49, 63, 62, 73, 59, 56, 50, 64, 60, 67, 67, 58,
                               59, 73, 77, 84, 82, 80, 84, 98 };

            // The labels for the bottom x axis. Note the "-" means a minor tick.
            string[] labels0 = { "0\nJun 4", "1",  "2",  "3",  "4",  "5",  "6",  "7",  "8",  "9",  "10", "11",
                                 "12",       "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "0\nJun 5" };

            // The labels for the top x axis. Note that "-" means a minor tick.
            string[] labels1 = { "Jun 3\n12", "13", "14",       "15", "16", "17", "18", "19", "20", "21",
                                 "22",        "23", "Jun 4\n0", "1",  "2",  "3",  "4",  "5",  "6",  "7", "8","9", "10", "11",
                                 "12" };

            // Create a XYChart object of size 310 x 310 pixels
            XYChart c = new XYChart(310, 310);

            // Set the plotarea at (50, 50) and of size 200 x 200 pixels
            c.setPlotArea(50, 50, 200, 200);

            // Add a title to the primary (left) y axis
            c.yAxis().setTitle("US Dollars");

            // Set the tick length to -4 pixels (-ve means ticks inside the plot area)
            c.yAxis().setTickLength(-4);

            // Add a title to the secondary (right) y axis
            c.yAxis2().setTitle("HK Dollars (1 USD = 7.8 HKD)");

            // Set the tick length to -4 pixels (-ve means ticks inside the plot area)
            c.yAxis2().setTickLength(-4);

            // Synchronize the y-axis such that y2 = 7.8 x y1
            c.syncYAxis(7.8);

            // Add a title to the bottom x axis
            c.xAxis().setTitle("Hong Kong Time");

            // Set the labels on the x axis.
            c.xAxis().setLabels(labels0);

            // Display 1 out of 3 labels on the x-axis. Show minor ticks for remaining labels.
            c.xAxis().setLabelStep(3, 1);

            // Set the major tick length to -4 pixels and minor tick length to -2 pixels (-ve means
            // ticks inside the plot area)
            c.xAxis().setTickLength2(-4, -2);

            // Set the distance between the axis labels and the axis to 6 pixels
            c.xAxis().setLabelGap(6);

            // Add a title to the top x-axis
            c.xAxis2().setTitle("New York Time");

            // Set the labels on the x axis.
            c.xAxis2().setLabels(labels1);

            // Display 1 out of 3 labels on the x-axis. Show minor ticks for remaining labels.
            c.xAxis2().setLabelStep(3, 1);

            // Set the major tick length to -4 pixels and minor tick length to -2 pixels (-ve means
            // ticks inside the plot area)
            c.xAxis2().setTickLength2(-4, -2);

            // Set the distance between the axis labels and the axis to 6 pixels
            c.xAxis2().setLabelGap(6);

            // Add a line layer to the chart with a line width of 2 pixels
            c.addLineLayer(data0, -1, "Red Transactions").setLineWidth(2);

            // Add an area layer to the chart with no area boundary line
            c.addAreaLayer(data1, -1, "Green Transactions").setLineWidth(0);

            // Output the chart
            viewer.Chart = c;

            //include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("clickable", "",
                                                "title='{dataSetName}\nHKT Jun {=3.5+{x}/24|0} {={x}%24}:00 (NYT Jun " +
                                                "{=3+{x}/24|0} {=({x}+12)%24}:00)\nHKD {={value}*7.8} (USD {value})'");
        }
예제 #27
0
        //
        // Create chart
        //
        private void createChart(RazorChartViewer viewer)
        {
            // In this example, the data points are unevenly spaced on the x-axis
            double[]   dataY = { 4.7, 4.7, 6.6, 2.2, 4.7, 4.0, 4.0, 5.1, 4.5, 4.5, 6.8, 4.5, 4, 2.1, 3, 2.5,
                                 2.5, 3.1 };
            DateTime[] dataX = { new DateTime(1999,                                                                   7,  1), new DateTime(2000,                 1,  1), new DateTime(2000,                 2,
                                                                                                                                                                                      1), new DateTime(2000,   4,                1), new DateTime(2000,   5,                8), new DateTime(2000,  7, 5),
                                 new DateTime(2001,                                                                   3,  5), new DateTime(2001,                 4,  7), new DateTime(2001,                 5, 9),
                                 new DateTime(2002,                                                                   2,  4), new DateTime(2002,                 4,  4), new DateTime(2002,                 5, 8),
                                 new DateTime(2002,                                                                   7,  7), new DateTime(2002,                 8, 30), new DateTime(2003,                 1, 2),
                                 new DateTime(2003,                                                                   2, 16), new DateTime(2003,                11,  6), new DateTime(2004,                 1, 4) };

            // Data points are assigned different symbols based on point type
            double[] pointType = { 0, 1, 0, 1, 2, 1, 0, 0, 1, 1, 2, 2, 1, 0, 2, 1, 2, 0 };

            // Create a XYChart object of size 480 x 320 pixels. Use a vertical gradient color from pale
            // blue (e8f0f8) to sky blue (aaccff) spanning half the chart height as background. Set
            // border to blue (88aaee). Use rounded corners. Enable soft drop shadow.
            XYChart c = new XYChart(480, 320);

            c.setBackground(c.linearGradientColor(0, 0, 0, c.getHeight() / 2, 0xe8f0f8, 0xaaccff),
                            0x88aaee);
            c.setRoundedFrame();
            c.setDropShadow();

            // Add a title to the chart using 15 points Arial Italic font. Set top/bottom margins to 12
            // pixels.
            ChartDirector.TextBox title = c.addTitle("Multi-Symbol Line Chart Demo", "Arial Italic", 15);
            title.setMargin2(0, 0, 12, 12);

            // Tentatively set the plotarea to 50 pixels from the left edge to allow for the y-axis, and
            // to just under the title. Set the width to 65 pixels less than the chart width, and the
            // height to reserve 90 pixels at the bottom for the x-axis and the legend box. Use pale blue
            // (e8f0f8) background, transparent border, and grey (888888) dotted horizontal and vertical
            // grid lines.
            c.setPlotArea(50, title.getHeight(), c.getWidth() - 65, c.getHeight() - title.getHeight() -
                          90, 0xe8f0f8, -1, Chart.Transparent, c.dashLineColor(0x888888, Chart.DotLine), -1);

            // Add a legend box where the bottom-center is anchored to the 12 pixels above the
            // bottom-center of the chart. Use horizontal layout and 8 points Arial font.
            LegendBox legendBox = c.addLegend(c.getWidth() / 2, c.getHeight() - 12, false, "Arial Bold",
                                              8);

            legendBox.setAlignment(Chart.BottomCenter);

            // Set the legend box background and border to pale blue (e8f0f8) and bluish grey (445566)
            legendBox.setBackground(0xe8f0f8, 0x445566);

            // Use rounded corners of 5 pixel radius for the legend box
            legendBox.setRoundedCorners(5);

            // Set the y axis label format to display a percentage sign
            c.yAxis().setLabelFormat("{value}%");

            // Set y-axis title to use 10 points Arial Bold Italic font
            c.yAxis().setTitle("Axis Title Placeholder", "Arial Bold Italic", 10);

            // Set axis labels to use Arial Bold font
            c.yAxis().setLabelStyle("Arial Bold");
            c.xAxis().setLabelStyle("Arial Bold");

            // We add the different data symbols using scatter layers. The scatter layers are added
            // before the line layer to make sure the data symbols stay on top of the line layer.

            // We select the points with pointType = 0 (the non-selected points will be set to NoValue),
            // and use yellow (ffff00) 15 pixels high 5 pointed star shape symbols for the points. (This
            // example uses both x and y coordinates. For charts that have no x explicitly coordinates,
            // use an empty array as dataX.)
            c.addScatterLayer(Chart.CTime(dataX), new ArrayMath(dataY).selectEQZ(pointType, Chart.NoValue
                                                                                 ).result(), "Point Type 0", Chart.StarShape(5), 15, 0xffff00);

            // Similar to above, we select the points with pointType - 1 = 0 and use green (ff00) 13
            // pixels high six-sided polygon as symbols.
            c.addScatterLayer(Chart.CTime(dataX), new ArrayMath(dataY).selectEQZ(new ArrayMath(pointType
                                                                                               ).sub(1).result(), Chart.NoValue).result(), "Point Type 1", Chart.PolygonShape(6), 13,
                              0x00ff00);

            // Similar to above, we select the points with pointType - 2 = 0 and use red (ff0000) 13
            // pixels high X shape as symbols.
            c.addScatterLayer(Chart.CTime(dataX), new ArrayMath(dataY).selectEQZ(new ArrayMath(pointType
                                                                                               ).sub(2).result(), Chart.NoValue).result(), "Point Type 2", Chart.Cross2Shape(), 13,
                              0xff0000);

            // Finally, add a blue (0000ff) line layer with line width of 2 pixels
            LineLayer layer = c.addLineLayer(dataY, 0x0000ff);

            layer.setXData(Chart.CTime(dataX));
            layer.setLineWidth(2);

            // Adjust the plot area size, such that the bounding box (inclusive of axes) is 10 pixels
            // from the left edge, just below the title, 25 pixels from the right edge, and 8 pixels
            // above the legend box.
            c.packPlotArea(10, title.getHeight(), c.getWidth() - 25, c.layoutLegend().getTopY() - 8);

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

            // Include tool tip for the chart
            viewer.ImageMap = c.getHTMLImageMap("", "", "title='{x|mmm dd, yyyy}: {value}%'");
        }
예제 #28
0
        protected void Generate_Forecast(int productid)
        {
            int     totalCount = 0;
            Product info       = ControllerManager.Product.GetById(productid);
            IList <ProductInformation> prodinfolist = ControllerManager.Product.GetProductInformation(info.ProductCode, "N/A", 0, 0, 1, 1, out totalCount, false);

            if (prodinfolist == null || prodinfolist.Count == 0)
            {
                return;
            }
            ProductInformation prodinfo = prodinfolist[0];

            leadtime = prodinfo.LeadTime + 10;
            //IList<TransactionHistoryWeekly> history = ControllerManager.TransactionHistoryWeekly.GetInfo(prodinfo.Id, Config.CurrentWeek, Config.CurrentDate.Year, 1);
            List <TransactionHistoryMonthly> historym = ControllerManager.TransactionHistoryMonthly.GetInfo(prodinfo.Id);

            this.Label12.Text = prodinfo.ProductCode;
            this.Label3.Text  = prodinfo.Description;
            this.Label5.Text  = prodinfo.Provider;
            this.Label7.Text  = prodinfo.Stock.ToString() + "/" + prodinfo.ReservedStock.ToString() + "/" + prodinfo.OrderedStock.ToString();
            this.Label9.Text  = prodinfo.RepositionLevel.ToString();
            this.Label11.Text = prodinfo.RepositionPoint.ToString();
            this.Label16.Text = prodinfo.LeadTime.ToString();
            this.Label1.Text  = prodinfo.Safety.ToString();

            this.Label01.Text  = GetTransactionMonthly(historym, 1).Sale.ToString();
            this.lblY01.Text   = GetTransactionMonthly(historym, 1).Year.ToString();
            this.Label02.Text  = GetTransactionMonthly(historym, 2).Sale.ToString();
            this.lblY02.Text   = GetTransactionMonthly(historym, 2).Year.ToString();
            this.Label03.Text  = GetTransactionMonthly(historym, 3).Sale.ToString();
            this.lblY03.Text   = GetTransactionMonthly(historym, 3).Year.ToString();
            this.Label04.Text  = GetTransactionMonthly(historym, 4).Sale.ToString();
            this.lblY04.Text   = GetTransactionMonthly(historym, 4).Year.ToString();
            this.Label05.Text  = GetTransactionMonthly(historym, 5).Sale.ToString();
            this.lblY05.Text   = GetTransactionMonthly(historym, 5).Year.ToString();
            this.Label06.Text  = GetTransactionMonthly(historym, 6).Sale.ToString();
            this.lblY06.Text   = GetTransactionMonthly(historym, 6).Year.ToString();
            this.Label07.Text  = GetTransactionMonthly(historym, 7).Sale.ToString();
            this.lblY07.Text   = GetTransactionMonthly(historym, 7).Year.ToString();
            this.Label08.Text  = GetTransactionMonthly(historym, 8).Sale.ToString();
            this.lblY08.Text   = GetTransactionMonthly(historym, 8).Year.ToString();
            this.Label09.Text  = GetTransactionMonthly(historym, 9).Sale.ToString();
            this.lblY09.Text   = GetTransactionMonthly(historym, 9).Year.ToString();
            this.Label010.Text = GetTransactionMonthly(historym, 10).Sale.ToString();
            this.lblY10.Text   = GetTransactionMonthly(historym, 10).Year.ToString();
            this.Label011.Text = GetTransactionMonthly(historym, 11).Sale.ToString();
            this.lblY11.Text   = GetTransactionMonthly(historym, 11).Year.ToString();
            this.Label012.Text = GetTransactionMonthly(historym, 12).Sale.ToString();
            this.lblY12.Text   = GetTransactionMonthly(historym, 12).Year.ToString();

            IList <Forecast> forecast = ControllerManager.Forecast.GetForecast(info, Config.CurrentWeek, Config.CurrentDate.Year);

            this.GridView1.DataSource = forecast;
            this.GridView1.DataBind();

            //------GRAFICO-------------------------------------------
            if (forecast.Count > 0)
            {
                string[] Titulos = new string[forecast.Count];
                double[] Stock   = new double[forecast.Count];
                double[] Ventas  = new double[forecast.Count];
                double[] Compras = new double[forecast.Count];
                for (int cont = 0; cont < forecast.Count; cont++)
                {
                    Stock.SetValue(forecast[cont].FinalStock, cont);
                    Ventas.SetValue(forecast[cont].Sale, cont);
                    Compras.SetValue(forecast[cont].Purchase, cont);
                    Titulos.SetValue(forecast[cont].Week.ToString(), cont);
                }

                XYChart c = new XYChart(480, 300, 0xeeeeff, 0x000000, 3);
                c.setPlotArea(50, 70, 410, 180, 0xffffff, -1, -1, 0xcccccc, 0xcccccc);
                c.addLegend(50, 50, false, "Arial Bold", 8).setBackground(Chart.Transparent);
                c.addTitle("Gráficos Estadísticos", "Verdana Bold", 12).setBackground(0xccccff, 0x000000, Chart.glassEffect());
                c.xAxis().setTitle("Semanas");
                c.yAxis().setTitle("Cantidad");

                Mark actual = c.xAxis().addMark(10, 0x000000, "SEMANA ACTUAL");
                actual.setLineWidth(1);
                actual.setAlignment(Chart.TopRight);
                actual.setFontAngle(90);
                Mark actual0 = c.xAxis().addMark(10 + prodinfo.LeadTime, 0x000000, "LEADTIME");
                actual0.setLineWidth(1);
                actual0.setAlignment(Chart.TopLeft);
                actual0.setFontAngle(90);
                LineLayer linea = c.addLineLayer();
                linea.setLineWidth(3);
                linea.addDataSet(Stock, 0x000000, "Stock Final");
                linea.addDataSet(Ventas, 0x00ff00, "Ventas");
                linea.addDataSet(Compras, 0x0000FF, "Compras");
                c.addAreaLayer(Stock, c.yZoneColor(forecast[10].Safety, unchecked ((int)0x50ff3c3c), unchecked ((int)0x500080c0)));
                c.xAxis().addZone(10, 10 + prodinfo.LeadTime, 0xdcdcdc);
                c.xAxis().setLabels(Titulos);
                c.xAxis().setLabelStep(2);
                WebChartViewer1.Image    = c.makeWebImage(Chart.PNG);
                WebChartViewer1.ImageMap = c.getHTMLImageMap("", "", "title='Semana {xLabel}: {value}'");
                WebChartViewer1.Visible  = true;
            }
            Product pfrom = ControllerManager.Product.GetAlternativeFrom(info);

            if (pfrom != null)
            {
                btnAlternativeFrom.Text            = pfrom.ProductCode;
                btnAlternativeFrom.CommandArgument = pfrom.Id.ToString();
                lblAlternativeFrom.Visible         = true;
            }
            Product pto = ControllerManager.Product.GetAlternativeTo(info);

            if (pto != null)
            {
                btnAlternativeTo.Text            = pto.ProductCode;
                btnAlternativeTo.CommandArgument = pto.Id.ToString();
                lblAlternativeTo.Visible         = true;
            }
        }
예제 #29
0
    private void SetMonthlyGraph()
    {
        int yearFrom = Convert.ToInt32((txtYearFrom.Text.Trim() == "" ? "0" : txtYearFrom.Text.Trim())) - 543;
        int yearTo = Convert.ToInt32((txtYearTo.Text.Trim() == "" ? "0" : txtYearTo.Text.Trim())) - 543;
        int currentmonth = 0;

        if (yearFrom < 0)
            yearFrom = 0;
        if (yearTo < 0)
            yearTo = 0;
        int tmp = yearFrom;
        if (yearFrom > yearTo)
        {
            yearFrom = yearTo;
            yearTo = tmp;
        }
        yearFrom += 543;
        yearTo += 543;

        switch (Request["currentyear"])
        {
            case "Á.¤.":
                currentmonth = 1;
                break;

            case "¡.¾.":
                currentmonth = 2;
                break;

            case "ÁÕ.¤.":
                currentmonth = 3;
                break;

            case "àÁ.Â.":
                currentmonth = 4;
                break;

            case "¾.¤.":
                currentmonth = 5;
                break;

            case "ÁÔ.Â.":
                currentmonth = 6;
                break;

            case "¡.¤.":
                currentmonth = 7;
                break;

            case "Ê.¤.":
                currentmonth = 8;
                break;

            case "¡.Â.":
                currentmonth = 9;
                break;

            case "µ.¤.":
                currentmonth = 10;
                break;

            case "¾.Â.":
                currentmonth = 11;
                break;

            case "¸.¤.":
                currentmonth = 12;
                break;
        }
        this.lnkYear.Text = GetTitle() + (yearFrom == yearTo ? "ã¹»Õ ¾.È. " + yearFrom.ToString() : " µÑé§áµè»Õ ¾.È. " + yearFrom.ToString() + "-" + yearTo.ToString());
        this.lblMonth.Text = ">> à´×͹ " + Request["currentyear"].ToString();
        this.pnlMonth.Visible = true;
        string[] labels = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" };

        XYChart c = new XYChart(750, 380, 15663086, 14540253, 0);
        string title = GetTitle() + (yearFrom == yearTo ? "ã¹»Õ ¾.È. " + yearFrom.ToString() : " µÑé§áµè»Õ ¾.È. " + yearFrom.ToString() + "-" + yearTo.ToString());
        c.addTitle(title, "Tahoma Bold", 12);

        c.setPlotArea(70, 80, 640, 230, c.gradientColor(0, 60, 0, 350, 16777215, 11189196), -1, Chart.Transparent, 1111);

        c.addLegend(30, 25, false, "Tahoma Bold", 8).setBackground(Chart.Transparent);
        c.xAxis().setLabels(labels);
        c.yAxis().setTickDensity(30);
        c.xAxis().setLabelStyle("Tahoma", 8, 001122, 90);
        c.yAxis().setLabelStyle("Tahoma", 8);
        c.yAxis().setLabelFormat("{value|0,}");
        c.xAxis().setWidth(2);
        c.yAxis().setWidth(2);
        c.yAxis().setTitle("¨Ó¹Ç¹", "Tahoma Bold", 10);
        c.xAxis().setTitle("Çѹ·Õè", "Tahoma Bold", 10);

        LineLayer layer = c.addLineLayer();
        layer.setLineWidth(1);
        AddData(layer, yearFrom - 543, yearTo - 543, currentmonth);
        vwChart.Image = c.makeWebImage(Chart.PNG);
        vwChart.ImageMap = c.getHTMLImageMap("", "", "title='Çѹ·Õè {xLabel}\r\n{value|,} ÃÒ¡Òà ({percent}%)'");
        this.pnlChart.Visible = true;
    }
예제 #30
0
    private void SetYearlyProductGraph()
    {
        this.pnlMonth.Visible = false;
        int yearFrom = Convert.ToInt32(this.txtYearFrom.Text == "" ? "0" : this.txtYearFrom.Text)-543;
        int yearTo = Convert.ToInt32(this.txtYearTo.Text == "" ? "0" : this.txtYearTo.Text)-543;
        string BarcodeFrom = this.txtBarcodeFrom.Text;
        string BarcodeTo = this.txtBarcodeTo.Text;
        if (yearFrom <0) yearFrom =0;
        if (yearTo < 0) yearTo = 0;
        int temp = yearFrom;
        if (yearFrom > yearTo)
        {
            yearFrom = yearTo;
            yearTo = temp;
        }
        yearFrom += 543;
        yearTo += 543;
        string[] labels = GetXLabel(yearFrom, yearTo);
        XYChart c = new XYChart(750, 380, 15663086, 14540253, 0);
        string title = GetReportTitle() + (yearFrom == yearTo ? "ã¹»Õ ¾.È. " + yearFrom.ToString() : " µÑé§áµè»Õ ¾.È. " + yearFrom.ToString() + "-" + yearTo.ToString());

        c.addTitle(title, "Tahoma Bold",12);
        c.setPlotArea(70, 80, 640, 230, c.gradientColor(0, 60, 0, 350, 16777215, 11189196), -1, Chart.Transparent, 1111);
        c.addLegend(30, 25, false, "Tahoma Bold", 8).setBackground(Chart.Transparent);c.xAxis().setLabels(labels);
        c.yAxis().setTickDensity(30);
        c.xAxis().setLabelStyle("Tahoma", 8, 001122, 90);
        c.yAxis().setLabelStyle("Tahoma", 8);
        c.yAxis().setLabelFormat("{value|0,}");
        c.xAxis().setWidth(2);
        c.yAxis().setWidth(2);
        c.yAxis().setTitle("¨Ó¹Ç¹ÊÔ¹¤éÒ/Çѵ¶Ø´Ôº", "Tahoma Bold", 10);
        c.xAxis().setTitle("»Õ ¾.È.", "Tahoma Bold", 10);

        LineLayer layer = c.addLineLayer();
        layer.setLineWidth(1);
        AddData(layer, yearFrom - 543, yearTo - 543,BarcodeFrom,BarcodeTo);
        vwChart.Image = c.makeWebImage(Chart.PNG);
        vwChart.ImageMap = c.getHTMLImageMap(GetReportPath()+ "?type=" + Request["type"] +  "&producegroup=" + this.cmbProduceGroup.SelectedItem.Value.ToString() + "&BarcodeFrom =" + this.txtBarcodeFrom.Text + "&BarcodeTo =" + this.txtBarcodeTo.Text+ "&currentyear={xLabel}&yearfrom=" + yearFrom.ToString() + "&yearto=" + yearTo.ToString(), "",
            "title='{dataSetName} ã¹»Õ {xLabel}\r\n{value|,} ÃÒ¡Òà ({percent}%)'");
    }