Chart Y-axis formatting

Hi,
I could build a chart, based on data from a Google Sheet, but I cannot format the Y-axis.
In my Google Sheet AND in Flipabit, the data are normal integers, but the Y-axis shows one decimal digit.
How can I fix this?

Wim

chart
chart_flipabit
chart_googlesheet

Guten Morgen,

hier ist ein Bsp.

import QtQuick 2.15
import QtQuick.Controls 2.15

ApplicationWindow {
    visible: true
    width: 400
    height: 300
    title: "Zahlenformatierung"

    Column {
        anchors.fill: parent
        spacing: 10
        padding: 20

        // Ganze Zahl ohne Formatierung
        Text {
            text: "Unformatierte Zahl: " + 123456789
            font.pointSize: 16
        }

        // Ganze Zahl mit Komma als Tausendertrennzeichen
        Text {
            text: "Formatierte Zahl: " + (123456789).toLocaleString()
            font.pointSize: 16
        }

        // Ganze Zahl mit benutzerdefiniertem Format (z.B. mit führenden Nullen)
        Text {
            text: "Zahl mit führenden Nullen: " + ("000" + 42).slice(-3) // Gibt '042' zurück
            font.pointSize: 16
        }
    }
}

Erklärung des Codes

  1. Unformatierte Zahl:
  • Zeigt einfach die ganze Zahl an.
  1. Formatierte Zahl:
  • Verwendet die Methode toLocaleString(), um die Zahl mit einem Komma als Tausendertrennzeichen anzuzeigen (abhängig von den regionalen Einstellungen).
  1. Zahl mit führenden Nullen:
  • Fügt führende Nullen hinzu, indem die Zahl in einen String umgewandelt wird und dann die letzten drei Zeichen extrahiert werden.

Thanks, but how can I “link” this code to the Y-axis of my chart?
It’s the first time I see such a code and I only see “text” (maybe a text-widget) ?

Hier ist ein tolles Bsp. wie man Widget mit Componenten Verknüpft.


Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.