MS图表控制量表 - 线图显示12个月
题
在我的X轴上,我有几个月。该图表最多显示11分,即同年1月 - 11月,但是当我增加12分(1月至12月)时,它将执行自动标签,并每4个月更改一次间隔。
如何更改图形以使其在使用自动标签之前显示12个月?
这是我当前正在使用的服务器控制代码。
<asp:CHART ID="Chart1" runat="server"
BorderColor="181, 64, 1" BorderDashStyle="Solid" BorderWidth="2" Height="296px"
ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)" ImageType="Png"
Palette="None" Width="700px"
BorderlineColor="">
<legends>
<asp:Legend BackColor="Transparent"
Font="Trebuchet MS, 8pt, style=Bold"
IsTextAutoFit="False" Name="Default" Alignment="Center"
DockedToChartArea="ChartArea1" Docking="Top" IsDockedInsideChartArea="False"
Title="Legend">
</asp:Legend>
</legends>
<series>
<asp:Series BorderColor="180, 26, 59, 105" BorderWidth="2" ChartType="Line"
Color="220, 65, 140, 240" MarkerSize="6"
Name="Series1" ShadowColor="Black"
ShadowOffset="2" XValueType="DateTime" YValueType="Double"
LabelFormat="c0" LegendText="Actual"
MarkerStyle="Circle">
</asp:Series>
<asp:Series BorderColor="180, 26, 59, 105" BorderWidth="2" ChartType="Line"
Color="220, 224, 64, 10" MarkerSize="6" Name="Series2" ShadowColor="Black"
ShadowOffset="2" XValueType="DateTime" YValueType="Double"
LabelFormat="c0" LegendText="Projected"
MarkerStyle="Circle">
</asp:Series>
<asp:Series BorderColor="180, 26, 59, 105" BorderWidth="2"
ChartArea="ChartArea1" ChartType="Line"
Legend="Default" Name="Series3" LabelFormat="c0" XValueType="DateTime"
YValueType="Double" Color="0, 192, 192" MarkerSize="6"
ShadowColor="Black" ShadowOffset="2" LegendText="Actual Credit Limit"
MarkerStyle="Circle">
</asp:Series>
</series>
<chartareas>
<asp:ChartArea BackColor="#DEEDF7" BackGradientStyle="TopBottom"
BackSecondaryColor="White" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid"
Name="ChartArea1" ShadowColor="Transparent">
<area3dstyle inclination="40" isclustered="False" isrightangleaxes="False"
lightstyle="Realistic" perspective="9" rotation="25" wallwidth="3" />
<axisy linecolor="64, 64, 64, 64" islabelautofit="False"
isstartedfromzero="False">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" Format="c0" />
<majorgrid linecolor="64, 64, 64, 64" />
</axisy>
<axisx linecolor="64, 64, 64, 64" intervaloffsettype="Months"
intervaltype="Months" islabelautofit="False" isstartedfromzero="False">
<LabelStyle Font="Trebuchet MS, 8.25pt, style=Bold" Angle="-60"
Format="MMM yy" />
<majorgrid linecolor="64, 64, 64, 64" />
</axisx>
</asp:ChartArea>
</chartareas>
</asp:CHART>
谢谢。
解决方案
尝试将图表的宽度更改为更高的值...
<asp:Chart ID="Chart1" runat="server"
BorderColor="181, 64, 1" BorderDashStyle="Solid" BorderWidth="2" Height="296px"
ImageLocation="~/TempImages/ChartPic_#SEQ(300,3)" ImageType="Png"
Palette="None" Width="800px"
BorderlineColor="">
尝试将Inverval属性设置为AXISX上的1:
<axisx Interval="1" linecolor="64, 64, 64, 64" intervaloffsettype="Months"
intervaltype="Months" islabelautofit="False" isstartedfromzero="False">
要充分了解如何格式图表轴,请查看:
(资源: Microsoft.com)
图表如何计算轴标签间隔?
在 类别轴, ,根据类别字段的类型确定最小值和最大值类型。数据集中的任何字段都可以分为三个类别类型之一:数字,日期/时间和字符串。
在类别轴上显示所有标签
在值轴上,轴间隔提供了图表上数据点的一致度量。但是,在 类别轴, ,此功能可能导致类别出现而无需轴标签。通常,您希望所有类别都被标记。您可以将间隔数设置为1以显示所有类别。有关更多信息,请参阅 如何:指定轴间隔.
其他提示
使用Microsoft图表
chart.ChartAreas[0].AxisY.ScaleBreakStyle = true
用自己的y值绘制y轴上的第二组值
不隶属于 StackOverflow