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 8 Oct 2023, 13:35 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 20 Oct 2023, 09:20
    0
    • V Vijaykarthikeyan
      8 Oct 2023, 13:35

      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 20 Oct 2023, 09:20 last edited by
      #2

      @Vijaykarthikeyan images.jpeg

      like this

      J 1 Reply Last reply 20 Oct 2023, 09:30
      0
      • V Vijaykarthikeyan
        20 Oct 2023, 09:20

        @Vijaykarthikeyan images.jpeg

        like this

        J Online
        J Online
        JonB
        wrote on 20 Oct 2023, 09:30 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 20 Oct 2023, 09:35
        0
        • J JonB
          20 Oct 2023, 09:30

          @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 20 Oct 2023, 09:35 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

          J 1 Reply Last reply 20 Oct 2023, 09:39
          0
          • V Vijaykarthikeyan
            20 Oct 2023, 09:35

            @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

            J Online
            J Online
            JonB
            wrote on 20 Oct 2023, 09:39 last edited by
            #5

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

            V 1 Reply Last reply 20 Oct 2023, 09:42
            1
            • J JonB
              20 Oct 2023, 09:39

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

              V Offline
              V Offline
              Vijaykarthikeyan
              wrote on 20 Oct 2023, 09:42 last edited by Vijaykarthikeyan
              #6

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

              J 1 Reply Last reply 20 Oct 2023, 09:43
              0
              • V Vijaykarthikeyan
                20 Oct 2023, 09:42

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

                J Online
                J Online
                JonB
                wrote on 20 Oct 2023, 09:43 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 20 Oct 2023, 09:48
                1
                • J JonB
                  20 Oct 2023, 09:43

                  @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 20 Oct 2023, 09:48 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?

                  J 1 Reply Last reply 20 Oct 2023, 09:49
                  0
                  • V Vijaykarthikeyan
                    20 Oct 2023, 09:48

                    @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?

                    J Online
                    J Online
                    JonB
                    wrote on 20 Oct 2023, 09:49 last edited by
                    #9

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

                    V 1 Reply Last reply 20 Oct 2023, 10:02
                    1
                    • J JonB
                      20 Oct 2023, 09:49

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

                      V Offline
                      V Offline
                      Vijaykarthikeyan
                      wrote on 20 Oct 2023, 10:02 last edited by
                      #10

                      @JonB ok..Ill try it

                      1 Reply Last reply
                      0
                      • V Offline
                        V Offline
                        Vijaykarthikeyan
                        wrote on 25 Oct 2023, 08:16 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 25 Oct 2023, 08:16

                        • Login

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