0

I am asking to the StackOverflow for the first time. If I rude to you, Tell me it. I will fix it. Thank you.

Asking...

In the BCG Library. Using Visual Studio 2012, MFC.

I want to control the display of data range in the chart of historical.

When I call below functions.

  • CBCGPChartAxis::SetFixedMaximumDisplayValue
  • CBCGPChartAxis::SetFixedMinimumDisplayValue
  • CBCGPChartAxis::SetScrollRange
  • CBCGPChartAxis::EnableScroll
  • CBCGPChartAxis::EnableZoom
  • CBCGPChartAxis::SetAlwaysShowScrollBar

The chart just worked once. And then, The chart seemed calling CBCGPChartAxis::SetAutoDisplayRange() automatically.

In other words. I don't want to call CBCGPChartAxis::SetAutoDisplayRange() automatically by the chart.

controlling the display range in a history' chart.

xMRi
  • 14,982
  • 3
  • 26
  • 59

2 Answers2

0

As far as I can see in the source code this function is called from serveral places. Maybe the easiest method to block this function is to call CBCGPChartSeries::ReplaceAxis and replace the automatically created axis with you implementation, that may ignore SetAutoDisplayRange.

If this doesn't help or as a method for further investigation:

Set a breakpoint and look into the callstack to see who calls this function and when this function is called. Again: As far as I understand the source code the function is called automatically when something changes in the chart.

xMRi
  • 14,982
  • 3
  • 26
  • 59
0
CBCGPChartAxis* pXAxis=***;
pXAxis->EnableScroll();
pXAxis->EnableZoom();
pXAxis->ShowScrollBar();
pXAxis->SetFixedUnitCount(20,1);

20 means the totle number of V grid line in every visible range and 1 menas there is one point in a single range of every grid. Might be your wanna.