Commit 4a55f91a authored by Marco Martin's avatar Marco Martin
Browse files

use the new shortName collapsing feature of legends

KQuickCharts now supports names and shortnames, the chart legends will
switch between the two depending on how much space is available
parent 93763af2
......@@ -69,9 +69,14 @@ Charts.BarChart {
}
colorSource: root.colorSource
nameSource: Charts.ModelSource {
chart.nameSource: Charts.ModelSource {
model: sensorsModel
roleName: "Name"
indexColumns: true
}
chart.shortNameSource: Charts.ModelSource {
roleName: "ShortName";
model: sensorsModel
roleName: "ShortName"
indexColumns: true
}
}
......
......@@ -80,9 +80,14 @@ Charts.LineChart {
}
colorSource: root.colorSource
nameSource: Charts.ModelSource {
chart.nameSource: Charts.ModelSource {
roleName: "Name";
model: sensorsModel
indexColumns: true
}
chart.shortNameSource: Charts.ModelSource {
roleName: "ShortName";
model: sensorsModel
roleName: "ShortName"
indexColumns: true
}
}
......
......@@ -68,6 +68,11 @@ ChartControls.PieChartControl {
indexColumns: true
}
chart.nameSource: Charts.ModelSource {
roleName: "Name";
model: valueSources[0].model;
indexColumns: true
}
chart.shortNameSource: Charts.ModelSource {
roleName: "ShortName";
model: valueSources[0].model;
indexColumns: true
......
......@@ -44,7 +44,8 @@ Faces.SensorFace {
ChartsControls.LegendDelegate {
Layout.fillWidth: true
name: sensor.shortName
name: sensor.name
shortName: sensor.shortName
value: sensor.formattedValue
colorVisible: false
colorWidth: 0
......
......@@ -58,7 +58,8 @@ Faces.SensorFace {
Layout.fillWidth: true
Layout.minimumHeight: isTextOnly ? 0 : implicitHeight
name: sensor.shortName
name: sensor.name
shortName: sensor.shortName
value: sensor.formattedValue
colorVisible: !isTextOnly
color: !isTextOnly ? root.colorSource.map[modelData] : "transparent"
......
......@@ -54,7 +54,8 @@ ChartsControls.Legend {
Repeater {
id: sensorsRepeater
delegate: ChartsControls.LegendDelegate {
name: sensor.shortName
name: sensor.name
shortName: sensor.shortName
value: sensor.formattedValue || ""
colorVisible: false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment