Hi,is it possible to show the Gridlines only if the x-axis-label has a special value?? For example I have a datetime-x-axis. When the chart contains more than 20 years I set the labels only on every 5. year. (this I can do with a special class which implements IRenderLabel) Is it possible? Perhaps it is possible to set this option in my Render-Class...?!?! Thank you so much!
Using FillSceneGraph event should be easier than using a custom layer. Here's a link to the documentation on FillSceneGraph:http://help.infragistics.com/Help/NetAdvantage/NET/2007.3/CLR2.0/html/Chart_Modify_Scene_Graph_Using_FillSceneGraph_Event.html
private void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e){ int counter = 1; foreach(Primitive p in e.SceneGraph) { if (p is Line && p.Path == "Border.Title.Grid.X") { if (counter % 2 == 0) p.PE.Stroke = Color.Transparent; counter++; } }}This would remove every other gridlnie on the x axis. Code similar to this can also be used in ChartDrawItem event if you don't have version 7.3.
Hi, thank you. I like to hide only certain gridlines...so I need the use of a custom layer OR handling FillSceneGraph? I thought this is the same? How can I handle FillSceneGraph? What is it and how much work is it? I copied the MyLayer-Class from the example..but I don't know what to write in the FillSceneGraph-method..?!
if you don't want to show the gridlines at all, you'll have to first see if your data spans over 20 years. After that it's simple:ultraChart1.Axis.X.MajorGridLines.Visible = false;ultraChart1.Axis.X.MinorGridLines.Visible = false;
Normally hiding only certain gridlines requires the use of a custom layer (or handling FillSceneGraph event), but if you have a time axis, you can simply set TickmarkStyle to DataInterval, TickmarkIntervalType to something like Weeks or Months and set TickmarkInterval to the number of units. This should automatically adjust the labels and tickmarks for the charts that use Time axis.