Hi.
I'm using Infragistics version 12.1.20121.2048.
I've built a bar chart and it works fine.
When the graphic has no data it shows a message that is defined through the property EmptyChartText. But I'd like to change the font-size of this message because it is too big.
Is that possible? I tried to do this:
Me.UltraChart1.Font.Size = New System.Web.UI.WebControls.FontUnit(10, UnitType.Pixel)
But the font size remains the same for the message.
Thank you
Hello soniaalves,
Maybe one possible approach could be if you are using your FillSceneGraph event. For example:
private void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e) { foreach (Primitive pr in e.SceneGraph) { if (e.SceneGraph.Count == 3 && pr.GetType() == typeof(Text)) { LabelStyle ls = ((Text)pr).GetLabelStyle(); ls.Font = new Font("Ariel", 12); ls.FontColor = Color.Green; ls.FontSizeBestFit = false; } } }
The result will be screenshot 1 (see below)
Another option could be if you set size of your Text primitive. For example:
private void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e) { foreach (Primitive pr in e.SceneGraph) { if (e.SceneGraph.Count == 3 && pr.GetType() == typeof(Text)) { ((Text)pr).FitsInBox = false; ((Text)pr).bounds = new Rectangle(100, 0, 500, 50); } } }
The result will be screenshot 2
Let me know if you have any questions.
That's it!
It works!
Thank you!
Hi,
I'm facing one more issue.
Instead of having tooltips can I show the values on the graphic? I mean, something like the image attached.
Looking at the screenshot, I suppose that you are using BarChart. One possible approach could be if you are using the code:
ChartTextAppearance chartTextAppearance1 = new ChartTextAppearance();
chartTextAppearance1.ChartTextFont =new System.Drawing.Font("Arial", 7F);
chartTextAppearance1.ClipText =false;
chartTextAppearance1.Column = -2;
chartTextAppearance1.ItemFormatString ="<DATA_VALUE:00.00>";
chartTextAppearance1.Row = -2;
chartTextAppearance1.Visible =true;
BarChartAppearance barChartAppearance1 = new BarChartAppearance();
barChartAppearance1.ChartText.Add(chartTextAppearance1);
this.ultraChart1.BarChart = barChartAppearance1;
Another option could be if you are using the designer. Please take a look at the screenshot below:
It's fine!
Thank you once again!