Poser une questionPoser une question
 

QuestionZoom bug

Toutes les réponses

  • jeudi 25 juin 2009 17:22ScottyDoesKnow Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     

    Alright so I don't know if that bug is in the chart because it's not happening now. It was happening just as I serialized the chart though, I checked. That one seems to have dissappeared and another one appeared though. In the serialized chart the X values are in seconds. I have a drop down which changes to milliseconds/microseconds/etc... When you do this it clears the series like so:

    SeriesChartType oldChartType = chartBottom.Series[SERIES_VS].ChartType;

                chartBottom.Series[SERIES_VS].Dispose();
                chartBottom.Series[SERIES_VS] = new Series(SERIES_VS)
                {
                    Color = Color.Black,
                    ChartType = oldChartType,
                    ChartArea = chartAreaBottom.Name
                };

    Then it refills the series with new points, calls RecalculateAxesScale() and resets the zoom. Now if you click on the graph (without zooming, just a click) the image you see switches to the previous graph. If the previous graph was zoomed in it will even show that, but when you zoom it acts on the regular graph. Hopefully you've seen this before because it will be harder to get you a project that it was just to serialize the chart.

  • jeudi 25 juin 2009 17:27ScottyDoesKnow Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     

    Oh and it won't happen unless you click the graph once before changing the scale also, and I walked through the click event and it doesn't change the graph at all. Also changed the series clearing to this with no change in results:

    Series oldSeries = chartBottom.Series[SERIES_VS];
                SeriesChartType oldChartType = oldSeries.ChartType;

                chartBottom.Series.Remove(oldSeries);
                oldSeries.Dispose();

                chartBottom.Series.Add(new Series(SERIES_VS)
                {
                    Color = Color.Black,
                    ChartType = oldChartType,
                    ChartArea = chartAreaBottom.Name
                });

  • lundi 29 juin 2009 17:51DelianTMSFT, ModérateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    Looks like known issue. Please use Chart.AxisViewChanged event to refresh the chart.


     private void chart1_AxisViewChanged(object sender, ViewEventArgs e)
    {
                chart1.Refresh();
    }
    Delian
  • lundi 29 juin 2009 18:27ScottyDoesKnow Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    That kind of works, though I had to put it on MouseDown since that's when it happens. I tried putting it in axisviewchanged but then the selection wouldnt go away when it zoomed and it was flashing around worse than before. There's still a problem though because when it does work it flashes to the old graph and then back to the right one.
  • mardi 30 juin 2009 19:33ScottyDoesKnow Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    Also, is there a known bug report somewhere? Something I could show to a client in case they think the problem is in my code?
  • mercredi 1 juillet 2009 20:09ScottyDoesKnow Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    Anybody got a fix for this?
  • vendredi 3 juillet 2009 11:52Simón P. Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    Also, is there a known bug report somewhere? Something I could show to a client in case they think the problem is in my code?
    Hi

    I've experienced an odd behaviour which looks like what's happening to you. I reported it here , and I was told it's a bug and will be fixed (hopefully). I hope this helps you. I didn't get a fix or workaround as I've stopped temporary using the charts.