Ovilia commented on issue #9151: Echarts Legend Not Appearing Using Dataset & 
Dimensions
URL: 
https://github.com/apache/incubator-echarts/issues/9151#issuecomment-427715165
 
 
   You have to set legend with series name.
   
   ```js
   option = {
       legend: {
           data: ['a', 'b']
       },
       dataset: [{
           source: [
               ['Test1', 10],
               ['Test2', 20]
           ],
           dimensions: ['Category', 'Value']
       },
       {
           source: [
               ['Test1', 15],
               ['Test2', 25]
           ],
           dimensions: ['Category', 'Value2']
       }],
       xAxis: [{ type: 'category' }, { type: 'category' }],
       yAxis: [{ position: 'left' }, { position: 'right' }],
       series: [
           {
               name: 'a',
               type: 'line',
               encode: {
                   x: 'Category',
                   y: 'Value'
               },
               datasetIndex: 0,
               yAxisIndex: 0
           },
           {
               name: 'b',
               type: 'line',
               encode: {
                   x: 'Category',
                   y: 'Value2'
               },
               datasetIndex: 1,
               yAxisIndex: 1
           }
       ],
       color: ["#c22e34", "#e7b603", "#0097da", "#2b821e", "#035daa", "#339ca8"]
   };
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to