仔细看了Scott写的如何开发MSchart,但始终还是有一个地方不明白,原话上说:可用于免费使用ASP.NET 3.5 。但在官方网站上的MSChart板块又看到了license,如果真有人想用的话,可以打微软的销售电话8008203800,或者等我知道了,我会为大家解答,因为这个好东西,我肯定会找机会用在我的项目里
今天又把MSChart拿出来研究,由于没有帮助文档,网上也没有案例和资料,唯一的一个帮助就是Microsoft给的200个例子。于是就看源码,看属性,尝试着每个属性的作用 -_- 这是很辛苦的
ok 终于基本搞懂了一些 首先介绍一下这两个图的做法
我把源码贴出来这是前台的
<axisy linecolor="64, 64, 64, 64" >
<labelstyle font="Trebuchet MS, 8.25pt, style="Bold" mce_style="Bold"" />
<majorgrid linecolor="64, 64, 64, 64" />
</axisy>
<axisx linecolor="64, 64, 64, 64" >
<labelstyle font="Trebuchet MS, 8.25pt, style="Bold" mce_style="Bold"" />
<majorgrid linecolor="64, 64, 64, 64" />
</axisx>
</asp:ChartArea>
</chartareas>
</asp:chart><br />
<asp:chart id="Chart2" runat="server" Height="250px" Width="400px"
ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)" Palette="BrightPastel"
imagetype="Png" BorderDashStyle="Solid" BackSecondaryColor="White"
BackGradientStyle="TopBottom" BorderWidth="2" backcolor="#D3DFF0" >
<legends>
<asp:Legend IsTextAutoFit="true" Alignment="Center" Docking="Top" Name="Default" BackColor="Transparent" Font="Trebuchet MS, 8.25pt, style="Bold" mce_style="Bold""></asp:Legend>
</legends>
<borderskin skinstyle="Emboss"></borderskin>
<series>
<asp:Series Name="TBU int`1 ( Ship/CW)" MarkerSize="8" BorderWidth="3"
XValueType="Double" ChartType="Line" MarkerStyle="Circle" ShadowColor="Black"
BorderColor="180, 26, 59, 105" Color="Red" ShadowOffset="2"
YValueType="Double">
</asp:Series>
<asp:Series Name="TBU China (include GSM)(Ship/CW)" ChartType=Line
BorderWidth="3" ShadowOffset="2" MarkerSize="8" MarkerStyle="Circle"
ShadowColor="Black" BorderColor="180, 26, 59, 105">
</asp:Series>
</series>
<chartareas>
<asp:ChartArea Name="Ship/CW" BorderColor="64, 64, 64, 64"
BorderDashStyle="Solid" BackSecondaryColor="White"
BackColor="64, 165, 191, 228" ShadowColor="Transparent"
BackGradientStyle="TopBottom" IsSameFontSizeForAllAxes="True" >
<area3dstyle PointDepth="150" PointGapDepth="150" Rotation="15" perspective="2" Inclination="20" LightStyle="Realistic" wallwidth="0" IsClustered="False"></area3dstyle>
<axisy linecolor="64, 64, 64, 64" >
<labelstyle font="Trebuchet MS, 8.25pt, style="Bold" mce_style="Bold"" />
<majorgrid linecolor="64, 64, 64, 64" />
</axisy>
<axisx linecolor="64, 64, 64, 64" >
<labelstyle font="Trebuchet MS, 8.25pt, style="Bold" mce_style="Bold"" />
<majorgrid linecolor="64, 64, 64, 64" />
</axisx>
</asp:ChartArea>
</chartareas>
</asp:chart>
这是后台的
// Set point labels
//Chart2.Series["TBU int`1 ( Ship/CW)"].IsValueShownAsLabel = true;
//Chart2.Series["TBU China (include GSM)(Ship/CW)"].IsValueShownAsLabel = true;
// Enable X axis margin
Chart2.ChartAreas["Ship/CW"].AxisX.IsMarginVisible = false;
// Enable 3D, and show data point marker lines
Chart2.ChartAreas["Ship/CW"].Area3DStyle.Enable3D = false;
Chart2.Series[0]["ShowMarkerLines"] = "True";
Chart2.Series[1]["ShowMarkerLines"] = "True";
}
如何配置就是我上一篇文章说的那样 可以看这里 vs2008 开发3D 报表 MSChart 开发全过程 带附件下载 开发日志(一)