Infragistics Home

Infragistics Forums

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

Missing Datapoint on Chart

Last post 08-22-2008 9:44 by [Infragistics] Max Rivlin. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-03-2008 14:39

    • zinsmeik
    • Top 500 Contributor
    • Joined on 01-16-2008
    • Points 285

    Missing Datapoint on Chart

     Hello,

     I have a Line Chart and Series attached from a Datatable. When I have a NULL Value within a series and using

    UltraChart1.LineChart.NullHandling = UltraChart.Shared.Styles.NullHandling.DontPlot

     then it happens that the Datapoint before the Null value is not rendered.

     Steps to reproduce:

    Imports Infragistics

    Public Class Form1

        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

            Dim UltraChart1 As New Win.UltraWinChart.UltraChart
            UltraChart1.ChartType = UltraChart.Shared.Styles.ChartType.LineChart


            Dim LineAppearance01 As New UltraChart.Resources.Appearance.LineAppearance

            With LineAppearance01
                .LineStyle.DrawStyle = UltraChart.Shared.Styles.LineDrawStyle.Solid
                .IconAppearance.Icon = UltraChart.Shared.Styles.SymbolIcon.Circle
                .IconAppearance.IconSize = UltraChart.Shared.Styles.SymbolIconSize.Large
                .Thickness = 3
                .IconAppearance.PE.Fill = Color.MidnightBlue
            End With


            UltraChart1.LineChart.LineAppearances.Add(LineAppearance01)

            UltraChart1.LineChart.NullHandling = UltraChart.Shared.Styles.NullHandling.DontPlot

            Dim dt As New DataTable("Data")

            dt.Columns.Add("Col1", GetType(System.Double))
            dt.Columns.Add("Col2", GetType(System.Double))
            dt.Columns.Add("Col3", GetType(System.Double))
            dt.Columns.Add("Col4", GetType(System.Double))
            dt.Columns.Add("Col5", GetType(System.Double))

            Dim dr As DataRow = dt.NewRow

            dr(0) = 8.0
            dr(1) = DBNull.Value
            dr(2) = 15.5
            dr(3) = 12.0
            dr(4) = 11

            dt.Rows.Add(dr)
            UltraChart1.DataSource = dt
            UltraChart1.DataBind()
            Me.Controls.Add(UltraChart1)
        End Sub
    End Class

    You see on the chart that the first datapoint [dr(0) = 8.0] is not on the chart.

    Change 

            dr(0) = 8.0
            dr(1) = DBNull.Value
            dr(2) = 15.5

    To

            dr(0) = 8.0
            dr(1) = 15.5
            dr(2) = DBNull.Value

    and try again. Then it works as expected

    I really need your help as my User do not trust anymore in the Application.

     Thanks

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

    Re: Missing Datapoint on Chart

    A line chart requires two consecutive non-null values to draw a section of the line. Any single value surrounded by null values will not be plotted. The same would apply if the first value is followed by a null value. You can try using a scatter chart with ConnectWithLines property set to true, or using FillSceneGraph event to cusom draw an icon where a data point should be. It's not a feature of the line chart to draw a single point.

    • Post Points: 20
  • 07-08-2008 1:40 In reply to

    • zinsmeik
    • Top 500 Contributor
    • Joined on 01-16-2008
    • Points 285

    Re: Missing Datapoint on Chart

     Hi,

     thanks for your response. 

    Excel does exactly what my user expect. It draws a point where the data is. How to submit a feature request ?

    Can you provide me with some information how to draw the point on myself ? how do I get the info which point is connected to a line and which point will not be draw ? 

     

    Thanks

     

    PS Im using Version 2008.1 

    • Post Points: 20
  • 07-08-2008 16:35 In reply to

    Re: Missing Datapoint on Chart

    A feature can be requested here:
    http://devcenter.infragistics.com/Protected/RequestFeature.aspx

    As for custom drawing the point, there isn't a way to determine if a line is connected to a given point, but you can loop through your data and look for values followed by nulls and draw a Symbol primitive there.

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Chart_Modify_Scene_Graph_Using_FillSceneGraph_Event.html

    I used the following logic to draw a symbol for each value from the data table

    private void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
    {
      IAdvanceAxis x = (IAdvanceAxis)e.Grid["X"];
      IAdvanceAxis y = (IAdvanceAxis)e.Grid["Y"];
     
      if (x != null && y != null)
      {
        for (int i = Convert.ToInt32(x.Minimum); i < Convert.ToInt32(x.Maximum); i++)
        {
          if (!(myTable.Rows[i][0] is DBNull))
          {
            Symbol s = new Symbol();
            s.icon =
    SymbolIcon.Circle;
            s.iconSize =
    SymbolIconSize.Small;
            s.PE.Fill =
    Color.Green;
            s.point =
    new Point((int)x.Map(i), (int)y.Map(myTable.Rows[i][0]));
            e.SceneGraph.Add(s);
          }
        }
      }
    }

    • Post Points: 20
  • 08-14-2008 9:29 In reply to

    • zinsmeik
    • Top 500 Contributor
    • Joined on 01-16-2008
    • Points 285

    Re: Missing Datapoint on Chart

    Hi,

     

    when I draw this Symbol no ToolTip's are shown for this symbol.

    How can I add the tooltip for these single point ?

     

    • Post Points: 20
  • 08-22-2008 9:44 In reply to

    Re: Missing Datapoint on Chart

    Sorry for the delayed response. To add a tooltip to a custom Symbol you need to add the following to your FillSceneGraph event handler:

    s.Caps =
    PCaps.HitTest | PCaps.Tooltip;
    s.Layer = e.ChartCore.GetChartLayer();
    s.DataPoint =
    new NumericDataPoint(12345,"label",false);

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