Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to add color gradient for different range of points in graph series in qml?
Forum Updated to NodeBB v4.3 + New Features

How to add color gradient for different range of points in graph series in qml?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
11 Posts 2 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vijaykarthikeyan
    wrote on last edited by
    #1

    I'm using Spline series..I want to show that the point in the series should have different colors based on the values within the range.. like..from 0 to 10 the range of points should be green,last 10 points in the color red..i tried to change the color of the line,but it is changing for the whole graph series

    V 1 Reply Last reply
    0
    • V Vijaykarthikeyan

      I'm using Spline series..I want to show that the point in the series should have different colors based on the values within the range.. like..from 0 to 10 the range of points should be green,last 10 points in the color red..i tried to change the color of the line,but it is changing for the whole graph series

      V Offline
      V Offline
      Vijaykarthikeyan
      wrote on last edited by
      #2

      @Vijaykarthikeyan images.jpeg

      like this

      JonBJ 1 Reply Last reply
      0
      • V Vijaykarthikeyan

        @Vijaykarthikeyan images.jpeg

        like this

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @Vijaykarthikeyan
        Is this what void QXYSeries::setPointsConfiguration(const QHash<int, QHash<QXYSeries::PointConfiguration, QVariant>> &pointsConfiguration) is for?

        Enables customizing the configuration of multiple points as specified by pointsConfiguration.

        V 1 Reply Last reply
        0
        • JonBJ JonB

          @Vijaykarthikeyan
          Is this what void QXYSeries::setPointsConfiguration(const QHash<int, QHash<QXYSeries::PointConfiguration, QVariant>> &pointsConfiguration) is for?

          Enables customizing the configuration of multiple points as specified by pointsConfiguration.

          V Offline
          V Offline
          Vijaykarthikeyan
          wrote on last edited by
          #4

          @JonB Yeah..I forgot to add that I'm using Qt 5.15.2..IN that documentatipon they have mentioned this function was introduced since 6.2

          JonBJ 1 Reply Last reply
          0
          • V Vijaykarthikeyan

            @JonB Yeah..I forgot to add that I'm using Qt 5.15.2..IN that documentatipon they have mentioned this function was introduced since 6.2

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @Vijaykarthikeyan ...And I have a feeling that means you cannot do it in 5.x....

            V 1 Reply Last reply
            1
            • JonBJ JonB

              @Vijaykarthikeyan ...And I have a feeling that means you cannot do it in 5.x....

              V Offline
              V Offline
              Vijaykarthikeyan
              wrote on last edited by Vijaykarthikeyan
              #6

              @JonB ok ..thank you..this is my longst search..now i find out the answer..thanks

              JonBJ 1 Reply Last reply
              0
              • V Vijaykarthikeyan

                @JonB ok ..thank you..this is my longst search..now i find out the answer..thanks

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #7

                @Vijaykarthikeyan
                See https://forum.qt.io/topic/112803/two-colors-of-the-qlineseries and https://www.qtcentre.org/threads/68025-Multiple-colors-QLineSeries-in-QtCharts#:~:text=The only way to get,Paste your code between them for workaround for 5.x?

                V 1 Reply Last reply
                1
                • JonBJ JonB

                  @Vijaykarthikeyan
                  See https://forum.qt.io/topic/112803/two-colors-of-the-qlineseries and https://www.qtcentre.org/threads/68025-Multiple-colors-QLineSeries-in-QtCharts#:~:text=The only way to get,Paste your code between them for workaround for 5.x?

                  V Offline
                  V Offline
                  Vijaykarthikeyan
                  wrote on last edited by
                  #8

                  @JonB Yeah..the 1st link says all..I have to split the series..each one for each color..But what if I want more colors?

                  JonBJ 1 Reply Last reply
                  0
                  • V Vijaykarthikeyan

                    @JonB Yeah..the 1st link says all..I have to split the series..each one for each color..But what if I want more colors?

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #9

                    @Vijaykarthikeyan What answer is there other than as many splits as different color segments?

                    V 1 Reply Last reply
                    1
                    • JonBJ JonB

                      @Vijaykarthikeyan What answer is there other than as many splits as different color segments?

                      V Offline
                      V Offline
                      Vijaykarthikeyan
                      wrote on last edited by
                      #10

                      @JonB ok..Ill try it

                      1 Reply Last reply
                      0
                      • V Offline
                        V Offline
                        Vijaykarthikeyan
                        wrote on last edited by
                        #11

                        i found the answer in https://forum.qt.io/topic/112803/two-colors-of-the-qlineseries/6?_=1698215994070

                        1 Reply Last reply
                        0
                        • V Vijaykarthikeyan has marked this topic as solved on

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved