C1Chart3D:How to keep axis visible but hide the data labels

Posted by: richard.sadler on 11 June 2018, 6:03 pm EST

  • Posted 11 June 2018, 6:03 pm EST

    Hi,

    Is it possible to hide the data labels on a C1Chart3D control but keep the axes displayed?

    I have a floating label to indicate the value where the cursor is, will hiding the labels affect this?

    thanks.

    Richard

  • Posted 12 June 2018, 2:52 pm EST

    I should Clarify, I mean the values that would be displayed on the Axes

  • Posted 13 June 2018, 12:30 am EST

    Hi Richard,

    To explicitly hide the all the labels on an axis, you can set the ‘AnnoPosition’ to ‘None’, for example:

    c1Chart3D1.ChartArea.AxisY.AnnoPosition = C1.Win.C1Chart3D.AnnoPositionEnum.None;
    

    However, this would hide the floating label too. In order to keep the floating label visible, you can instead use the DataLabels/ValueLabels ‘AnnoMethod’ and add just one DataLabel/ValueLabel to that axis.

    xDataLabel = c1Chart3D1.ChartGroups.ColumnLabels.AddNewLabel();
    c1Chart3D1.ChartArea.AxisX.AnnoMethod = C1.Win.C1Chart3D.AnnotationMethodEnum.DataLabels;
    

    and update the position of this label using the MouseMove event.

    int rowIdx=0, colIdx=0;
    c1Chart3D1.ChartGroups[0].ChartData.CoordToDataIndex(e.X, e.Y, ref colIdx, ref rowIdx);
    xDataLabel.Index = colIdx;
    xDataLabel.Text = colIdx.ToString();
    

    Attached is a small sample that demonstrates the same. Please let us know if this helps.

    Regards,

    Ankit

    3DAxisAndDataLabels.zip

  • Posted 18 June 2018, 3:57 pm EST

    Thanks Ankit, that worked perfectly!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels