Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

I am new to chart Control.
I build a chart control successfully with two ChartArea.

My Problem:
When i run the page it is dividing the charts into 2 areas each 50%.
But i want to fix that ChartAreas Height.
Means:I want to fix the height of the 1 Chart Area as 30% and 2nd Chart Area as 70%.
By default it is taking 50% for chart area 1 and 50% for Chart Area 2.

Please Help to Fix the Problem.

Thanks In Advance
Posted
Updated 21-Aug-12 19:30pm
v2

1 solution

Chart Control adjusts the chart area heights itself. ChartArea does not posses Height property to set the height.
http://msdn.microsoft.com/en-us/library/dd456621.aspx
So alternate way to achieve it is to have 2 different Chart objects.
 
Share this answer
 
Comments
Mac12334 22-Aug-12 2:30am    
I already tried using two chart control it is showing problem.
I have Share that problem in below link
http://www.codeproject.com/Questions/441619/Chart-control-problem

So I tried using one chart control with two chartarea its working fine but need to fix the height problem.
pramod.hegde 22-Aug-12 8:25am    
Hi,
Have you tried like this,

<div style="height:150px;">
<div style="height:100px;">
<asp:Chart ID="Chart1" runat="server">
<series>
<asp:Series Name="Series1">


<chartareas>
<asp:ChartArea AlignWithChartArea="NotSet" Name="ChartArea1" BorderColor="Red" AlignmentStyle="PlotPosition">



</div>
<div style="height:50px;">
<asp:Chart ID="Chart2" runat="server">
<series>
<asp:Series Name="Series2">


<chartareas>
<asp:ChartArea AlignWithChartArea="NotSet" Name="ChartArea2" BorderColor="Red" AlignmentStyle="PlotPosition">



</div>
</div>

I have tried and this works perfectly fine.
Mac12334 23-Aug-12 9:03am    
http://msdn.microsoft.com/en-us/library/dd456621.aspx
in the above url given by you can set the height and width of chartarea.
No need to use div .

Thanks for your valuable solution.
Thanks a ton.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900