Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello every one,
I'm working on chart in asp.net and c#, I built the chart and is working good, but I'm looking for something like different colour in the same column

for example the yaxies from 0 to 8
I want the column start from 0 to 3 in red colour and from 3 to 8 in green colour

I have this code for chart

ASP.NET
<asp:Chart ID="Chart7" runat="server">
            <Series>
                <asp:Series Name="Series1" XValueMember="file" YValueMembers="time" IsVisibleInLegend="true">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                    <AxisY Minimum="0" Maximum="8" Interval="1"></AxisY>
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>


What I have tried:

I try to do it in code behind in c# but it does not work
Chart7.Series[0].Points[3].Color=System.Drawing.Color.Red;

Any suggestion ??
Posted
Updated 13-May-16 21:33pm
Comments
CHill60 13-May-16 8:25am    
What do you mean by "does not work"? Does point 3 turn red? You would need to do this for each of the points with the appropriate colour

1 solution

Try color pattern in CSS and then apply it to asp:Chart using Javascript.

OR have a look at HTML5 Charts and Gauges for jQuery, ASP.NET and OpenUI5[^]
 
Share this answer
 

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