|
Stacked Bar Chart with dual y-axis |
Posted by Mandar Akre on Apr-09-2012 23:26 |
|
Hi,
I need to plot a stacked graph and also have 2 y-axis so that i can show daily data on one y-axis and on other y-axis i need to plot weekly data from the stack. Can you help me with a small example. |
Re: Stacked Bar Chart with dual y-axis |
Posted by Peter Kwan on Apr-10-2012 02:31 |
|
Hi Mandar,
For a short example, woudl you mind to clarify exactly the type of chart you need, the programming language you are using, and whether you are writing a web or desktop application?
For the exactly chart you need, doi you mean you want to plot daily bar charts using simple bars (not stacked), and then at the end of each week, you would like to plot a stacked bar combining the data of all daily bars in that week, and use a different y-axis? May be an example chart image may help me understand the chart you need.
Regards
Peter Kwan |
Re: Stacked Bar Chart with dual y-axis |
Posted by Mandar Akre on Apr-10-2012 15:43 |
|
Hi i have attached a sample graph for your reference. I want the left y-axis scale in scale w.r.t 04th Apr & 28th Mar graphs. I have used 2 datasets array for stacked array.
|
Re: Stacked Bar Chart with dual y-axis |
Posted by Mandar Akre on Apr-10-2012 16:17 |
|
I am using C# on visual studio 2010 backend is sql. |
Re: Stacked Bar Chart with dual y-axis |
Posted by Peter Kwan on Apr-11-2012 01:39 |
|
Hi Mandar,
For your case, an example is like:
double[] blueDailyData = {333, 222, Chart.NoValue, Chart.NoValue};
double[] orangeDailyData = {111, 122, Chart.NoValue, Chart.NoValue};
double[] blueWeeklyData = {Chart.NoValue, Chart.NoValue, 444, 712};
double[] orangeWeeklyData = {Chart.NoValue, Chart.NoValue, 314, 412};
BarLayer dailyBarLayer = c.addBarLayer(Chart.Stack);
dailyBarLayer.addDataSet(blueDailyData, 0x3366ff, "xxxx");
dailyBarLayer.addDataSet(orangleDailyData, 0xffcc66, "zzzz");
BarLayer weeklyBarLayer = c.addBarLayer(Chart.Stack);
weeklyBarLayer.addDataSet(blueWeeklyData , 0x3366ff, "xxxx");
weeklyBarLayer.addDataSet(orangeWeeklyData , 0xffcc66, "zzzz");
weeklyBarLayer.setUseYAxis2();
Hope this can help.
Regards
Peter Kwan |
Re: Stacked Bar Chart with dual y-axis |
Posted by Mandar Akre on Apr-11-2012 15:51 |
|
Hi Peter,
Thanks a lot again for solving this issue. I really appreciate the way you provide all the solutions. Thanks again !! |
|