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/11/04 03:52:38 UTC

[GitHub] [incubator-echarts] wlyaini commented on issue #13535: The font size problem of the label of the line graph set by echarts rendered by svg

wlyaini commented on issue #13535:
URL: https://github.com/apache/incubator-echarts/issues/13535#issuecomment-721497149


   var high_chart = echarts.init(document.getElementById('high'), null, {renderer: 'svg', width: "450px", height: "230px"});
       var high_option = {
           tooltip: {
               show: true,
               trigger: "axis",
               axisPointer: {
                   type: "shadow"
               },
               backgroundColor: "transparent", //设置背景
               formatter: function(params){
                   console.log(params[0]);
                   let str2 = '';
                   for(let x in params){
                       str2 += params[x].marker + params[x].seriesName +":"+params[x].value + "<br>";
   
                   }
                   let str = '<div class="self-tooltip">' +
                       '<div class="tooltip-title">' +
                       params[0].name +
                       '</div>' + str2 +
                   '</div>';
                   return str;
               }
           },
           legend: {
               show: false,
               top: 0,
               x: 'right',
               textStyle: {
                   color: '#fff'
               },
               data: ['企业']
           },
           grid: {
               top: 30,
               left: 0,
               right: 0,
               bottom: 0,
               containLabel: true
           },
           xAxis: {
               axisLine: {
                   lineStyle: {
                       color: '#2d3265'
                   }
               },
               axisLabel: {
                   color: '#838dec'
               },
               axisTick: {
                   show: false
               },
               data: [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019]
           },
           yAxis: {
               name: '单位:家',
               nameTextStyle: {
                   color: '#838dec'
               },
               splitNumber: 4,
               axisLine: {
                   show: false
               },
               axisLabel: {
                   show: true,
                   color: 'transparent'
               },
               axisTick: {
                   show: false
               },
               splitLine: {
                   lineStyle: {
                       color: '#2d3265'
                   }
               }
           },
           series: [
               {
                   name: '企业',
                   type: 'line',
                   lineStyle: {
                       color: '#fff77a'
                   },
                   itemStyle: {
                       color: '#fff77a'
                   },
                   label: {
                       show: true,
                       position: 'top',
                       color: '#838dec',
                       fontSize: 10,
                   },
                   areaStyle: {
                       color: 'rgba(103,116,255,.1)'
                   },
                   data: [256,280,320,260,344,360,487,520,777,845]
               }
           ]
       };
       high_chart.setOption(high_option);


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