Answer the question
In order to leave comments, you need to log in
How to change font options in BarChart QML value labels?
Good time. I've been trying for weeks to change the font settings for value labels in BarChart chart bars
Using QtCharts 2.2
Creating a chart from JS
function drawBar(){
barChartView.removeAllSeries();
barChartView.titleFont = Qt.font({bold:true,pixelSize:20});
var barAbstractSeries = barChartView.createSeries(ChartView.SeriesTypeBar); // AbstractSeries object
barAbstractSeries.clear();
barAbstractSeries.append(qsTr("Resource Consumption"),getData());
barAbstractSeries.labelsVisible = true;
barAbstractSeries.labelsAngle = 270;
barAbstractSeries.barWidth = 0.8;
barChartView.axisX().categories = getCats();
barChartView.axisX().labelsAngle = 270;
barChartView.axisX().labelsFont = Qt.font({bold:true,pixelSize:15});
barChartView.axisX().gridLineColor = "#b1b1b1";
barChartView.axisY().gridLineColor = "#b1b1b1";
...
}
ChartView {
id: barChartView
width: parent.width
height: 400
antialiasing: false
legend.visible: false
backgroundColor: "#85FFFFFF"
animationOptions: ChartView.SeriesAnimations
animationDuration: 50
titleFont: Qt.font({pointSize: 15})
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question