We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Customising the StockAndVolumeChartSample Sample

Welcome from France,

The sample StockAndVolumeChartSample is really useful. It allows to have 2 charts interiors inside an unique chart area.
You can see the picture inside the zip file.
By default the 2 series share the area and everyone has 50% of the space.
How can I use the chart component to impose by example the first serie has 2/3 of the area and the second 1/3 ?

By advance thank you for your help,

Fernando.

StockAndVolume.png


Attachment: StockAndVolume_8c6dd5a0.zip

1 Reply

VA Vinothkumar Arumugam Syncfusion Team May 27, 2015 08:24 AM UTC

Hi Fernando Atienza,

We have analyzed your query.

You can able to customize chart size by ChartAxisLayout. ChartAxisLayout is used to add multiple axes collection .Each axis depends on one or more series.

You can achieve your requirements by applying following code snippet

Code Snippet [WF]:

· Create ChartAxisLayout

ChartAxisLayout layout1 = new ChartAxisLayout();

ChartAxisLayout layout2 = new ChartAxisLayout();

Layout1 for SecondaryAxis (yaxis)

Layout2 for PrimaryYAxis

· Add axes to the ChartAxisLayout

layout1.Axes.Add(yaxis);

layout2.Axes.Add(this.chartControl1.PrimaryYAxis);

· Set size of the layout as follows

layout1.Height =new System.Web.UI.WebControls.Unit("66%");

layout2.Height = new System.Web.UI.WebControls.Unit("34%");

· After completing above steps added these two layouts into chartControl.The chartControl has chart components.

this.chartControl1.ChartArea.YLayouts.Add(layout1);

this.chartControl1.ChartArea.YLayouts.Add(layout2);

Screenshot:

We have prepared a sample based on your requirements ,you can download it from below sample link

Sample Link:
Stock-and-Volume_Chart.zip

Please let us know if you have any concern.

Thanks,

Vinothkumar Arumugam.


Loader.
Live Chat Icon For mobile
Up arrow icon