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 2020/07/31 05:20:50 UTC

[GitHub] [incubator-echarts] chenghongyao commented on issue #11667: Need example to color the line conditionally between data points. i.e., multi color line chart

chenghongyao commented on issue #11667:
URL: https://github.com/apache/incubator-echarts/issues/11667#issuecomment-666928881


   i have the same issue,it only work when dimension is 0 or 1,which is not what i really want.
   
   option = {
               // Make gradient line here
               visualMap: [{
                   show: true,
                   top:'10%',
                   type: 'continuous',
                   dimension:2, //don't work
                   min: 1,
                   max: 3,
                   inRange:{
                       color:['red','green']
                   }
               }],
               xAxis:{
                   min:'dataMin',
                   max:'dataMax',
               },
               yAxis: {},
               series: [{
                   type: 'line',
                   showSymbol: false,
                   data:[
                   [0.284,3.000,3.00],
                   [0.296,4.000,4.00],
                   [0.307,3.000,3.00],
                   [0.320,2.000,2.00],
                   [0.331,0.000,0.00],
                   [0.341,1.000,1.00],
                   [0.356,2.000,2.00],
                   [0.363,2.000,2.00],
                   [0.374,3.000,3.00],
                   [0.385,2.000,2.00],
                   [0.395,2.000,2.00],
                   [0.402,3.000,3.00],
                   [0.413,2.000,2.00],
                   [0.424,2.000,2.00],
                   [0.436,2.000,2.00],
                   [0.448,1.000,1.00],
                   [0.459,2.000,2.00],
                   [0.472,2.000,2.00],
                   [0.483,2.000,2.00],
                   [0.493,1.000,1.00],
                   [0.506,2.000,2.00],
                   [0.514,3.000,3.00],
                   [0.526,2.000,2.00],
                   [0.537,4.000,4.00],
                   [0.540,2.000,2.00],
                   [0.551,0.000,0.00],
                   [0.566,2.000,2.00],
                   [0.573,3.000,3.00],
                   [0.584,2.000,2.00],
                   [0.595,3.000,3.00],
                   [0.605,4.000,4.00],
                   [0.612,3.000,3.00],
                   [0.623,3.000,3.00],
                   [0.634,0.000,0.00],
                   [0.646,2.000,2.00],
                   [0.658,4.000,4.00],
                   [0.669,3.000,3.00],
                   [0.682,3.000,3.00],
                   [0.693,2.000,2.00],
                   [0.703,1.000,1.00],
                   [0.716,1.000,1.00],]
               }]
           };
   ![dIm0](https://user-images.githubusercontent.com/16313317/89002736-74d18300-d330-11ea-842d-365239b79201.png)
   ![dim1](https://user-images.githubusercontent.com/16313317/89002740-769b4680-d330-11ea-9c89-f7c4e3030129.png)
   ![dim2](https://user-images.githubusercontent.com/16313317/89002747-7d29be00-d330-11ea-98ea-5ecd91678b65.png)
   
   
   


----------------------------------------------------------------
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.

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