0

i'm having a candle stick chart (stock chart OHLC) which shows more than one company data in a single chart, for a single chart i'm able to draw chart, but with multiple company data, i'm unable to draw chart.

using "aspose.cell" for .net. exporting the charts into excel, for that chart with multiple company can be drawn as seperate stockcharts, but i want to make it into one single chart.

Code:

 if (sheetIndex == 0)
        {
            sheetIndex = a_workbook.Worksheets.Add();
        }
        ACell.Worksheet chart1 = a_workbook.Worksheets[sheetIndex];

        chart1.Name = "CandleStick_Chart";

        //Create chart of Type  StockOpenHighLowClose
        int chartIndex = chart1.Charts.Add(AChart.ChartType.StockOpenHighLowClose, csrowno, 1, csrowno + 50, 30);

        //Initialize Chart
        AChart.Chart chartsh = chart1.Charts[chartIndex];
        chartsh.NSeries.Add("Data!" + GetColumnName(valuePair.stcol) + "15:" + GetColumnName(valuePair.stcol + 3) + (valuePair.endrow), true);
        chartsh.NSeries.CategoryData = "Data!" + GetColumnName(valuePair.stcol - 1) + "15:" + GetColumnName(valuePair.stcol - 1) + (valuePair.endrow);//   "Data!A2:A4";
       
        chartsh.NSeries[0].Name = "Open"; chartsh.NSeries[1].Name = "High";
        chartsh.NSeries[2].Name = "Low"; chartsh.NSeries[3].Name = "Close";
        chartsh.NSeries[0].DownBars.Area.ForegroundColor = System.Drawing.Color.Green;
        chartsh.NSeries[0].UpBars.Area.ForegroundColor = System.Drawing.Color.Red;
        chartsh.Title.Text = valuePair.chartname;
        chartsh.Title.TextFont.Color = System.Drawing.Color.Black;
        chartsh.Title.TextFont.IsBold = true;
        chartsh.Title.TextFont.Size = 12;

below shows the chart i want to draw -its candle stick ohlc -stock chart. enter image description here

Community
  • 1
  • 1
Annadate Piyush
  • 458
  • 5
  • 18
  • Can you show the expected output? It usually makes no sense to traw two companies in the same chart becauses prices tend to be very different. One possibility: Overlap the _percentage changes_ for two companies... – DrKoch Feb 13 '15 at 09:41
  • image attached is what output expected. i agree that stock value may overlap, still want to have that feature. in above image there are 2 company data with stocks range 1k - 2k and at 6k (y axis) – Annadate Piyush Feb 13 '15 at 09:43
  • Posted at http://www.aspose.com/community/forums/thread/606966.aspx too – Saqib Razzaq Feb 16 '15 at 11:25
  • Yes, but needs to have view from other too apart from aspose. – Annadate Piyush Feb 16 '15 at 11:31

0 Answers0