Jul 02, 2012, 1:14 PM
[CLOSED] column chart label line wrapping
I'm trying to have the labels in the x-axis wrap instead of just truncating them. I've got up to the following sample code and please show me how to accomplish this. Thanks
(note: while writing the following sample code I find a problem of the first element in the list not showing in the chart. May be something also to look at?)
(note: while writing the following sample code I find a problem of the first element in the list not showing in the chart. May be something also to look at?)
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
strCoreCollectives.Data = new object[] {
new {
instCode="1234567890",
instName="test12345678901234567890",
amount=10000,
instPerc=10
},
new {
instCode="3234567890",
instName="test32345678901234567890",
amount=30000,
instPerc=30
},
new {
instCode="2234567890",
instName="test22345678901234567890",
amount=20000,
instPerc=20
}
};
strCoreCollectives.DataBind();
}
</script>
<!DOCTYPE html>
<html>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Panel ID="Panel1" runat="server" >
<Items>
<ext:Chart
ID="Chart4"
runat="server"
StyleSpec="background:#fff;"
Shadow="true"
Animate="true"
Width="300"
Height="300"
Theme="Base:gradients"
>
<Store>
<ext:Store ID="strCoreCollectives" runat="server" AutoDataBind="true">
<Model>
<ext:Model ID="Model12" runat="server" IDProperty="instCode">
<Fields>
<ext:ModelField Name="instCode" />
<ext:ModelField Name="instName" />
<ext:ModelField Name="amount" Type="Float"/>
<ext:ModelField Name="instPerc" Type="Float" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<Axes>
<ext:CategoryAxis
Fields="instName"
Title="Instruments"
Position="Bottom"
>
<LabelTitle FontSize="10" >
</LabelTitle>
<Label FontSize="8" >
<Rotate Degrees="270" />
<Renderer Handler="return Ext.String.ellipsis(value, 15, false);" />
</Label> </ext:CategoryAxis>
<ext:NumericAxis
Fields="amount"
Position="Left"
Grid="true"
Title="Amount"
>
<LabelTitle FontSize="10" >
</LabelTitle>
<Label FontSize="8" ></Label>
</ext:NumericAxis>
</Axes>
<Series>
<ext:ColumnSeries
Highlight="true"
XField="instName"
YField="amount"
Axes="Left" Column="true"
></ext:ColumnSeries>
</Series>
</ext:Chart>
</Items>
</ext:Panel>
</form>
</body>
</html>
Last edited by Daniil; Jul 05, 2012 at 12:12 PM.
Reason: [CLOSED]