图表ASP.NET C#中的一列中的两种颜色 [英] Two colour in one column in chart ASP.NET C#

查看:49
本文介绍了图表ASP.NET C#中的一列中的两种颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在asp.net和c#的图表上工作,我建立了图表并且运行良好,但我正在寻找同样颜色的东西栏目



例如从0到8的yaxies

我希望列从0到3以红色开始,从3到8绿色



我有这个代码图表



 <   asp:Chart     ID   =  Chart7    runat   = 服务器 >  
< 系列 >
< asp:Series 名称 = Series1 < span class =code-attribute> XValueMember = file YValueMembers = time IsVisibleInLegend = true >
< / asp:Series >
< / Series >
< ChartAreas >
< asp:ChartArea 名称 = ChartArea1 >
< span class =code-keyword>< AxisY Minimum = 0 最大 = 8 Interval = 1 > < / AxisY > ;
< / asp:ChartArea >
< / ChartAreas >
< / asp:Chart < span class =code-keyword>>





我的尝试:



我尝试在c#后面的代码中执行它但是它不起作用

Chart7.Series [0] .Points [3] .Color = System.Drawing.Color.Red;



有什么建议吗?

解决方案

试试CSS中的颜色模式,然后将其应用于asp:使用Javascript的图表。



或者看看用于jQuery,ASP.NET和OpenUI5的HTML5图表和量表 [ ^

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: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 ??

解决方案

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[^]


这篇关于图表ASP.NET C#中的一列中的两种颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆