我與NA 11.2.20112.2025。後面的代碼:
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.Add("year", typeof(string));
dt.Columns.Add("numUsers", typeof(int));
dt.Rows.Add(new object[] { "2005", -100 });
dt.Rows.Add(new object[] { "2006", 160 });
dt.Rows.Add(new object[] { "2007", -250 });
dt.Rows.Add(new object[] { "2008", 500 });
dt.Rows.Add(new object[] { "2009", -860 });
dt.Rows.Add(new object[] { "2010", 600 });
UltraChart1.Axis.X.RangeMin = -200;
UltraChart1.Axis.X.RangeMax = 500;
UltraChart1.Data.DataSource = dt;
UltraChart1.ChartType = ChartType.BarChart;
UltraChart1.Data.DataBind();
}
標記:
<igchart:UltraChart ID="UltraChart1" runat="server" ChartType="BarChart" EmptyChartText="Data Not Available. Please call UltraChart.Data.DataBind() after setting valid Data.DataSource"
Version="11.1">
<Effects>
<Effects>
<igchartprop:GradientEffect />
</Effects>
</Effects>
<ColorModel AlphaLevel="150" ColorBegin="Pink" ColorEnd="DarkRed" ModelStyle="CustomSkin"
Scaling="Oscillating">
</ColorModel>
<Axis>
<PE ElementType="None" Fill="Cornsilk"></PE>
<X Visible="True" TickmarkInterval="40" LineThickness="1" TickmarkStyle="Smart">
<MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255">
</MajorGridLines>
<MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255">
</MinorGridLines>
<Labels ItemFormatString="<DATA_VALUE:00.##>" HorizontalAlign="Far" VerticalAlign="Center"
Orientation="VerticalLeftFacing" Font="Verdana, 7pt" FontColor="DimGray">
<SeriesLabels HorizontalAlign="Far" VerticalAlign="Center" Orientation="VerticalLeftFacing"
Font="Verdana, 7pt" FontColor="DimGray" FormatString="">
<Layout Behavior="Auto">
</Layout>
</SeriesLabels>
<Layout Behavior="Auto">
</Layout>
</Labels>
</X>
<Y Visible="True" TickmarkInterval="0" LineThickness="1" TickmarkStyle="Smart">
<MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255">
</MajorGridLines>
<MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255">
</MinorGridLines>
<Labels ItemFormatString="<ITEM_LABEL>" HorizontalAlign="Far" VerticalAlign="Center"
Orientation="Horizontal" Font="Verdana, 7pt" FontColor="DimGray">
<SeriesLabels HorizontalAlign="Center" VerticalAlign="Center" Orientation="VerticalLeftFacing"
Font="Verdana, 7pt" FontColor="DimGray">
<Layout Behavior="Auto">
</Layout>
</SeriesLabels>
<Layout Behavior="Auto">
</Layout>
</Labels>
</Y>
<Y2 Visible="False" TickmarkInterval="0" LineThickness="1" TickmarkStyle="Smart">
<MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255">
</MajorGridLines>
<MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255">
</MinorGridLines>
<Labels ItemFormatString="<ITEM_LABEL>" Visible="False" HorizontalAlign="Near"
VerticalAlign="Center" Orientation="Horizontal" Font="Verdana, 7pt" FontColor="Gray">
<SeriesLabels HorizontalAlign="Center" VerticalAlign="Center" Orientation="VerticalLeftFacing"
Font="Verdana, 7pt" FontColor="Gray">
<Layout Behavior="Auto">
</Layout>
</SeriesLabels>
<Layout Behavior="Auto">
</Layout>
</Labels>
</Y2>
<X2 Visible="False" TickmarkInterval="40" LineThickness="1" TickmarkStyle="Smart">
<MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255">
</MajorGridLines>
<MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255">
</MinorGridLines>
<Labels ItemFormatString="<DATA_VALUE:00.##>" Visible="False" HorizontalAlign="Far"
VerticalAlign="Center" Orientation="VerticalLeftFacing" Font="Verdana, 7pt" FontColor="Gray">
<SeriesLabels HorizontalAlign="Far" VerticalAlign="Center" Orientation="VerticalLeftFacing"
Font="Verdana, 7pt" FontColor="Gray" FormatString="">
<Layout Behavior="Auto">
</Layout>
</SeriesLabels>
<Layout Behavior="Auto">
</Layout>
</Labels>
</X2>
<Z Visible="False" TickmarkInterval="0" LineThickness="1" TickmarkStyle="Smart">
<MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255">
</MajorGridLines>
<MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255">
</MinorGridLines>
<Labels ItemFormatString="" HorizontalAlign="Near" VerticalAlign="Center" Orientation="Horizontal"
Font="Verdana, 7pt" FontColor="DimGray" Visible="False">
<SeriesLabels HorizontalAlign="Near" VerticalAlign="Center" Orientation="Horizontal"
Font="Verdana, 7pt" FontColor="DimGray">
<Layout Behavior="Auto">
</Layout>
</SeriesLabels>
<Layout Behavior="Auto">
</Layout>
</Labels>
</Z>
<Z2 Visible="False" TickmarkInterval="0" LineThickness="1" TickmarkStyle="Smart">
<MajorGridLines Visible="True" DrawStyle="Dot" Color="Gainsboro" Thickness="1" AlphaLevel="255">
</MajorGridLines>
<MinorGridLines Visible="False" DrawStyle="Dot" Color="LightGray" Thickness="1" AlphaLevel="255">
</MinorGridLines>
<Labels ItemFormatString="" Visible="False" HorizontalAlign="Near" VerticalAlign="Center"
Orientation="Horizontal" Font="Verdana, 7pt" FontColor="Gray">
<SeriesLabels HorizontalAlign="Near" VerticalAlign="Center" Orientation="VerticalLeftFacing"
Font="Verdana, 7pt" FontColor="Gray">
<Layout Behavior="Auto">
</Layout>
</SeriesLabels>
<Layout Behavior="Auto">
</Layout>
</Labels>
</Z2>
</Axis>
<Tooltips Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" />
</igchart:UltraChart>
其顯示我的消極和積極整數無一例外...樣的工程,即使我不設定最小/最大範圍
什麼是X軸'RangeMin'設置爲? – AakashM
我還沒有設定。我相信當值爲負時,我需要設置RangeMin,否則設置RangeMax。這有意義嗎? –
我相當肯定你需要設置它們兩個,並且你需要確保'RangeMin'小於'RangeMax'。我懷疑給你錯誤的是'RangeMin'仍然是它的默認值(可能爲零),並且你將'RangeMax'設置爲小於'RangeMin',這是不允許的。 – AakashM