@@ -443,7 +443,17 QStringList ChartAxis::createValueLabels(int ticks) const | |||
|
443 | 443 | QByteArray array = format.toLatin1(); |
|
444 | 444 | for (int i = 0; i < ticks; i++) { |
|
445 | 445 | qreal value = m_min + (i * (m_max - m_min) / (ticks - 1)); |
|
446 | labels << QString().sprintf(array, value); | |
|
446 | if (format.contains("d") | |
|
447 | || format.contains("i") | |
|
448 | || format.contains("c")) | |
|
449 | ||
|
450 | labels << QString().sprintf(array, (qint64)value); | |
|
451 | else if (format.contains("u") | |
|
452 | || format.contains("o") | |
|
453 | || format.contains("x", Qt::CaseInsensitive)) | |
|
454 | labels << QString().sprintf(array, (quint64)value); | |
|
455 | else | |
|
456 | labels << QString().sprintf(array, value); | |
|
447 | 457 | } |
|
448 | 458 | } |
|
449 | 459 |
@@ -97,12 +97,14 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
97 | 97 | /*! |
|
98 | 98 | \property QValueAxis::labelFormat |
|
99 | 99 | Defines the label format for the axis. |
|
100 | See QString::sprintf() for the details. | |
|
100 | Supported specifiers are: d, i, o, x, X, f, F, e, E, g, G, c | |
|
101 | See QString::sprintf() for additional details. | |
|
101 | 102 | */ |
|
102 | 103 | /*! |
|
103 | 104 | \qmlproperty real ValueAxis::labelFormat |
|
104 | 105 | Defines the label format for the axis. |
|
105 | See QString::sprintf() for the details. | |
|
106 | Supported specifiers are: d, i, o, x, X, f, F, e, E, g, G, c | |
|
107 | See QString::sprintf() for additional details. | |
|
106 | 108 | */ |
|
107 | 109 | |
|
108 | 110 | /*! |
General Comments 0
You need to be logged in to leave comments.
Login now