You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/07/15 21:34:00 UTC

[GitHub] [echarts] 97morningstar opened a new issue, #17387: How to set up a linear gradient that can use the whole dataset by adding colorStops?

97morningstar opened a new issue, #17387:
URL: https://github.com/apache/echarts/issues/17387

   ### What problem does this feature solve?
   
   I'm trying to setup a linear gradient, using color stops and percentages, I am using the dataset component to hold my data. But, the only thing I can find for the moment applies the style to each item instead of the entire dataset [Please see the image below], and I need to be able to add colorStops for the whole data based on the offset/percentage
   
   ![image](https://user-images.githubusercontent.com/26909101/179313351-d4b17282-3b4a-4d70-850a-fd4a3549398e.png)
   
   How can I accomplish this? I am using echarts 5.1.1
   
   
   ### What does the proposed API look like?
   
   ```
   option = {
     xAxis: {},
     yAxis: {},
     dataset: {
       source: [
           [10.0, 8.04],
           [8.07, 6.95],
           [13.0, 7.58],
           [9.05, 8.81],
           [11.0, 8.33],
           [14.0, 7.66],
           [13.4, 6.81],
           [10.0, 6.33],
           [14.0, 8.96],
           [12.5, 6.82],
           [9.15, 7.2],
           [11.5, 7.2],
           [3.03, 4.23],
           [12.2, 7.83],
           [2.02, 4.47],
           [1.05, 3.33],
           [4.05, 4.96],
           [6.03, 7.24],
           [12.0, 6.26],
           [12.0, 8.84],
           [7.08, 5.82],
           [5.02, 5.68]
         ],
     },
     series: [
       {
         symbolSize: 20,
         type: 'scatter',
         colorBy: 'data',
         color: {
                   type: 'linear',
                   colorStops: [{
                     offset: 0, color: 'red' // color at 0%
                   }, {
                     offset: 1, color: 'blue' // color at 100%
                   }],
                 global: false,
                 }
       }
     ]
   };
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] uCloudCastle commented on issue #17387: How to set up a linear gradient that can use the whole dataset by adding colorStops?

Posted by GitBox <gi...@apache.org>.
uCloudCastle commented on issue #17387:
URL: https://github.com/apache/echarts/issues/17387#issuecomment-1198973296

   +1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org