import QtQuick import QtQuick.Window import QtGraphs Window { width: 800 height: 600 visible: true title: "Click Signal" property int colorIndex: 0 property var borderColors: ["purple", "blue", "green", "black"] GraphsView { id: graphView anchors.fill: parent panStyle: GraphsView.PanStyle.Drag axisX: ValueAxis { id: axisX min: 0 max: 12 } axisY: ValueAxis { id: axisY min: -15 max: 40 } AreaSeries { id: myAreaSeries color: "red" selected: true hoverable: true borderColor: borderColors[0] borderWidth: 3 upperSeries: LineSeries { id: s1 XYPoint { x: 0.0; y: -3.5 } XYPoint { x: 1.0; y: -5.0 } XYPoint { x: 2.0; y: -2.5 } XYPoint { x: 2.5; y: -4.0 } XYPoint { x: 3.0; y: -4.2 } } onClicked: { console.log("clicked!!") myAreaSeries.color = myAreaSeries.color == "red" ? "blue" : "red" } } } }