1

I have to create a chart and use QChart. So I looked at the QChart dynamic spline example (because I'm going to create a dynamic chart), and I found something strange there.

Below is the launch screen. The code is the example code provided by Qt, except for setTickCount().

launch screen image: launch screen image

dynamic spline chart example code from Qt home page

I changed the value of tick from 5 to 10. I thought that if I changed it to 10, it would appear as 0, 1, 2, 3, 4, ..., 10 as the scale value. But it does not.

When moving by the scale interval, I think that it should be increased only by the scale interval exactly. What should I do? The code looks fine.

underscore_d
  • 6,309
  • 3
  • 38
  • 64
minjee
  • 43
  • 1
  • 7

1 Answers1

0

You might want to try calling void QValueAxis::applyNiceNumbers(), somewhere in the constructor. Take a look at void QValueAxis::applyNiceNumbers() in Qt documentation.

  • I used applyNiceNumbers () on both handleTimeout () and constructor. There is no change when used in the constructor, and handleTimeout () cannot be used because the scale value changes too much. – minjee Jan 09 '18 at 13:28