Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
How to change display of zero value in 3D chart?
posted

I’m using a 3D Cylinder Column Chart.  These charts are then used in creating a PDF by way of the Infragistics.Documents.Report object.  Is it possible to display data values that are zero (0) as nothing, or as a different color?  i.e. I don’t want a flat, round, red disk displayed when the value is zero (0).

Parents
  • 630
    Verified Answer
    posted

    You should handle the ChartDrawItem event and remove the drawing of anything that has to do with the 0 valued data points. Here's some sample code:

        protected void UltraChart1_ChartDrawItem(object sender, Infragistics.UltraChart.Shared.Events.ChartDrawItemEventArgs e)
        {
            if (e.Primitive.Value != null)
            {
                Double val = (Double)e.Primitive.Value;
                if (val == 0)
                {
                    e.Primitive.Visible = false;
                }
            }
        }

     WARNING: This is very hacked together code, you'd probably want to handle exceptions and do a better check to make sure what you're dealing with is actually going to give you a Primitive.Value that is a double, but this should set you on the right track.

     Good luck, and let me know how it goes.

Reply Children