Click here to Skip to main content
12,997,038 members (48,055 online)
Rate this:
Please Sign up or sign in to vote.
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 21-Aug-12 3:44am
Updated 21-Aug-12 19:30pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Chart Control adjusts the chart area heights itself. ChartArea does not posses Height property to set the height.
So alternate way to achieve it is to have 2 different Chart objects.
MAC123456 22-Aug-12 2:30am
I already tried using two chart control it is showing problem.
I have Share that problem in below link

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

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

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

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

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


I have tried and this works perfectly fine.
MAC123456 23-Aug-12 9:03am
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)

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 22 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100