我用MsChart做了个图表,用了两个Series,但是生成图表后数据顺序不是我要的,如图所示,我想把两个蓝的放一起,两个橙色放一起、
HTML:
<asp:Chart ID="Chart1" runat="server" Width="800" Height="500"
Palette="BrightPastel"
BorderColor="26, 59, 105"
BackColor="#D3DFF0"
BorderDashStyle="Solid"
BackSecondaryColor="White"
BackGradientStyle="TopBottom"
BorderWidth="2"
ImageStorageMode="UseHttpHandler">
<Series>
<asp:Series Name="Series1" >
</asp:Series>
<asp:Series Name="Series2">
</asp:Series>
<asp:Series Name="Series3">
</asp:Series>
</Series>
<Legends>
</Legends>
<ChartAreas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BackSecondaryColor="White"
BackColor="64, 165, 191, 228" ShadowColor="Transparent" BackGradientStyle="TopBottom">
<Area3DStyle Rotation="10" Perspective="10" Inclination="15" IsRightAngleAxes="False"
WallWidth="0" IsClustered="False" />
<AxisY LineColor="64, 64, 64, 64">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</AxisY>
<AxisX LineColor="64, 64, 64, 64">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" />
<MajorGrid LineColor="64, 64, 64, 64" />
</AxisX>
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
cs:
void BindData()
{
DataTable gx = new DataTable();
gx = SetData("01");
Chart1.Series[0].Points.DataBindXY(gx.DefaultView, "groupId", gx.DefaultView, "rate");
DataTable yd = new DataTable();
yd = SetData("02");
Chart1.Series[1].Points.DataBindXY(yd.DefaultView, "groupId", yd.DefaultView, "rate");
}
你绘制的时候把两个蓝的放一起就可以了 就是你赋值的时候 DataBindXY的时候
建议楼主,如果是web端的程序,还是考虑客户端生成图表算了,
www.highcharts.com
这个好像是收费的?
@garfieldzf: 收费又有什么关系呢?这个都是JS文件
@chenping2008: 收费的,用这个做的图表右下角有HighCharts的水印
@garfieldzf: 其实你看到那个水印,是个html控件,你完全可以移除掉它
建议使用: 图表控件amCharts http://www.ec78.com/jianzhi/forum.php?mod=viewthread&tid=13127&highlight=%E5%9B%BE%E8%A1%A8