Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

More readable legend for LineChart on CompositeChart?

Last post 07-07-2008 10:15 by [Infragistics] Max Rivlin. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 06-09-2008 12:39

    • ukjenks
    • Not Ranked
    • Joined on 05-06-2008
    • Points 160

    More readable legend for LineChart on CompositeChart?

    Is there a way to make the legend more readable for a LineChart on a CompositeChart.  To make it easier to understand my question I have included the image of my sample app:

    The lines on the legend are so small that it is difficult to tell what they are.  I am using NetAdvantage for Windows Forms 2008 Vol. 1.  I would appreciate any advice.

    Thanks,
    Kerry Jenkins

    • Post Points: 20
  • 06-11-2008 16:13 In reply to

    Re: More readable legend for LineChart on CompositeChart?

    Answer

    you can use FillSceneGraph or ChartDtawItem event to do this.

    private void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
    {
       foreach (Primitive p in e.SceneGraph)
       {
          Polyline poly = p as Polyline;
          if (poly!= null && poly.Path!=null && poly.Path.ToLower().IndexOf("legend") != -1)
          {
             poly.PE.StrokeWidth = 5;
          }
       }
    }

    • Post Points: 65
  • 06-11-2008 17:12 In reply to

    • ukjenks
    • Not Ranked
    • Joined on 05-06-2008
    • Points 160

    Re: More readable legend for LineChart on CompositeChart?

    That worked great!

    Thanks

    • Post Points: 5
  • 07-02-2008 14:01 In reply to

    • spejic
    • Not Ranked
    • Joined on 06-05-2008
    • Points 125

    Re: More readable legend for LineChart on CompositeChart?

    [Infragistics] Max Rivlin:

    you can use FillSceneGraph or ChartDtawItem event to do this.

    private void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
    {
       foreach (Primitive p in e.SceneGraph)
       {
          Polyline poly = p as Polyline;
          if (poly!= null && poly.Path!=null && poly.Path.ToLower().IndexOf("legend") != -1)
          {
             poly.PE.StrokeWidth = 5;
          }
       }
    }

     

    How would you do this is 2007 Vol.1 version? It doesn't seem to contain a SceneGraph collection.

    • Post Points: 20
  • 07-02-2008 14:12 In reply to

    Re: More readable legend for LineChart on CompositeChart?

    For any version below 7.3 you have to implement a custom layer and put that code in FillSceneGraph method.

    Here's the help link with information on how to implement a custom layer:
    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Chart_Writing_a_Layer_Class.html

    • Post Points: 20
  • 07-03-2008 9:49 In reply to

    • spejic
    • Not Ranked
    • Joined on 06-05-2008
    • Points 125

    Re: More readable legend for LineChart on CompositeChart?

    [Infragistics] Max Rivlin:

    For any version below 7.3 you have to implement a custom layer and put that code in FillSceneGraph method.

    Here's the help link with information on how to implement a custom layer:
    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Chart_Writing_a_Layer_Class.html

    Hi Max,

     Thanks for the quick response. I've implemented the custom layer and have added it to my ASPX page. However, I got a runtime error. The error is "Specified cast is not valid".

    Here is the code for the FillSceneGraph implementation in the custom layer:

    Public Sub FillSceneGraph(ByVal scene As Infragistics.UltraChart.Core.SceneGraph) Implements Infragistics.UltraChart.Core.Layers.ILayer.FillSceneGraph

    For Each p As Primitive In scene

    Dim poly As Polyline = CType(p, Polyline) 'The error is on this line

    If Not poly Is Nothing AndAlso Not poly.Path = Nothing AndAlso Not poly.Path.ToLower().IndexOf("legend) = -1 Then

    poly.PE.StrokeWidth = 5

    End If

    Next

    End Sub

    This is where I'm actually calling the above layer (after I've set up the Legend stuff):

    chart.CompositeChart.Legends.Add(legend)

    chart.Layer.Add("SceneGraph Layer", New SceneGraphLayer)

    chart.UserLayerIndex = New String() {"Default", "SceneGraph Layer"}

    chart.InvalidateLayers()

    Any further help would be appreciated.

    • Post Points: 20
  • 07-07-2008 10:15 In reply to

    Re: More readable legend for LineChart on CompositeChart?

    use

    dim poly as Polyline
    if (typeof p is Polyline) then
       poly = CType(p, Polyline)
    endif

    CType cannot handle this cast directly

    • Post Points: 5
Page 1 of 1 (7 items)
Powered by Community Server (Commercial Edition), by Telligent Systems