XuanmoFeng commented on issue #6562: How to add custom visualisation to 
Superset?
URL: 
https://github.com/apache/incubator-superset/issues/6562#issuecomment-449347086
 
 
   ```
   const propTypes = {
       data: PropTypes.arrayOf(PropTypes.shape({
           country_id: PropTypes.string,
           metric: PropTypes.number,
       })),
       width: PropTypes.number,
       height: PropTypes.number,
       country: PropTypes.string,
       linearColorScheme: PropTypes.string,
       mapBaseUrl: PropTypes.string,
       numberFormat: PropTypes.string,
       sliceId: PropTypes.number,
   };
   
   
   function EchartsCountryMap(element, props) {
   
       const {
           data,
           width,
           height,
           country,
           linearColorScheme,
           mapBaseUrl = 
'/static/assets/src/visualizations/EchartsCountryMap/countries',
           numberFormat,
           sliceId,
       } = props;
   
   
       const div = d3.select(element);
       const sliceID = 'echarts_slice_' + sliceId;
       const html = '<div id=' + sliceID + ' style="width:' + width + 
'px;height:' + height + 'px;"></div>';
       div.html(html); // reset
       const myChart = echarts.init(document.getElementById(sliceID));
   .......
   
   ```
   You can write others codes like the countryMap 

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