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
615
Turn on/off datalabels shown for each point on graph via button click?
posted

In the chart wizard, I checked the box to turn on datalabels, which makes a ChartTextAppearance and adds it to LineChartAppearance, then sets to linechart.  I am trying to have this as a dynamic feature, so I made the variables accessible to me.  However, when I do chartTextAppearance1.Visible = !chartTextAppearance1.Visible from a button click, it does nothing!  Also, if I try and add the ChartTextAppearance to LineChartAppearance later, it has no effect.  So far it only seems to work on InitializeComponent the first time.  Is there any way to do this?

  • 28496
    Offline posted

     try calling the chart's InvalidateLayers() method after changing the Visible property.