Hi,
I am creating a Bar Chart and setting its series label. But the series label text is somehow truncated.
The code and the generated chart is as follows:
NumericSeries numSeries = new NumericSeries(); numSeries.Points.Add(new NumericDataPoint(Convert.ToDouble(45), "Pass", false));numSeries.Points.Add(new NumericDataPoint(Convert.ToDouble(75), "Unknown", false));numSeries.Points.Add(new NumericDataPoint(Convert.ToDouble(45), "Fail", false));numSeries.Label = "Y Axis Text";myInfraChart.Series.Add(numSeries);
I want my series label text to always appear even if text labels are very large (they will be trunctaed in that case) and even when chart is 3D.
Thanks.
Sounds like you have some existing layout behaviors in your Y axis series labels. It doesn't look like you need any of them for this chart.
Hi Max,
The code I have posted above is the only one I have on my page and it still is truncating series label. But when I use StackColumn chart, I get the label correctly. I agree its a bit weird.
Hi Tsvetelina,
Thanks for the help - it worked!.
But I may also need to clip my labels - use ClipTextAxisLabelLayoutBehavior when my labels are large in size. Again then I cant see the series label text. Even when I dont use ClipTextAxisLabelLayoutBehavior and my labels are large, then also the series label text is missing.
I also tried increasing the Y axis extent but it renders series label when extent is increased to very large value and then chart size is much reduced. Setting orientation to vertical also doesnt work.
Hello Sandeep,
Thank you for the update.
As Max has mentioned, the reason causing this is the behaviors which have been set through the designer:
<Labels ItemFormatString="<DATA_VALUE:00.##>" HorizontalAlign="Far"
<Labels ItemFormatString="<DATA_VALUE:00.##>" 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>
</Labels>
Let us know if you need further assistance regarding this.
I am really sorry but I did not get your solution. As for designer view, it always gives "Error creating control" for my chart so I cant see anything there.
I tried to manually add the markup provided above but issue was still there. It'd be great if you could attach the complete sample source code for this.
Thanks a lot.
What version of Visual Studio do you use?
I recommend you running the Toolbox utility for the purpose.
http://help.infragistics.com/NetAdvantage/ASPNET/2010.3?page=Web_Getting_Started_Running_the_Toolbox_Utility.html
I am attaching the default markup generated when a chart is dragged to the form.
Let me know if you need further assistance
Thanks for the attached sample. Its working as expected.
But probably I havent been clear enough - this works when text is small size, but when label text is large and I use ClipText behavior, then again the series label is hidden. I mentioned this in my post yesterday but probably didnt mention clearly.