1

im using QML QtCharts to plot XYPoint in a LineSeries. everything works fine except the problem that i have with relative position of x and y axes which specifically are ValueAxis, im looking for a solution to make x axis lay on the line y = 0 like picture below

as far as i can see, there is no official solution for my problem and i can just align x axis to top or bottom of the PlotArea and not in the y = 0 ,so any advise or help would be greatly appreciated

ChartView {
    id: chartView
    ValueAxis {
        id: axisY1
        min: -1
        max: 4
    }
    ValueAxis {
        id: axisY2
        min: -10
        max: 5
    }

    ValueAxis {
        id: axisX
        min: 0
        max: 1024
    }

    LineSeries {
        id: lineSeries1
        name: "signal 1"
        axisX: axisX
        axisY: axisY1
    }
Matt
  • 7,255
  • 2
  • 12
  • 34
  • As I understand it, you want the X-axis to lie on the Y-axis at a point when y= 0? If yes, what is your real target? I mean, what a reason not let the axes be in some natural order? – folibis Jun 09 '20 at 07:15
  • Yes folibis, that's exactly what i want. the reason is because the plot shows value of an interested variable over time and update itself every 10ms. my employer wants to intuitively see when this variable will become negative or positive over time by checking the drawn line and see if it crossed x axis or not. i know that i can use `grid` but he wants to see just one horizontal line as axis on the screen, one way which is on top of my mind is setting x - axis invisible and draw a twin axis with canvas in the desired position but i look for a neat way if exist any, Thanks – Mohammad Khajezadeh Jun 09 '20 at 10:05

0 Answers0