title: Formatter function to add labels in scatter graph in echarts by baidu
body: <p>I am implementing a scatterplot using echarts library by baidu. I am referring to <a href="https://ecomfe.github.io/echarts/doc/example/scatter1.html#-en" rel="nofollow noreferrer">this</a> example. I have made modifications in its properties according to my requirement. I have increased the bubble size by mentioning a symbol size in 'series' like this:</p>
  
  <pre><code>    series : [
                  {    
                    symbolSize : 20,
                    type :'scatter',
                    data : [ some coordinate values ],
                    .
                    .   //rest of the properties
                    .
  
                    },
                ]
  </code></pre>
  
  <p>I have done this to include customized labels inside the bubbles. For this, I have modified the 'itemStyle' in 'series' as follows:</p>
  
  <pre><code>itemStyle: {
                    normal: {
                              color:'blue', 
                              label:{
                              textStyle:{
                                          fontWeight:'bold',
                                          fontSize:15
                                          },
                             show:true,
                             position: 'inside',
                             formatter: function(value)
                              {
                                  if (value=='[10][20]')
                                  return 'some label'
                                  else
                                  return 'NA'
                              }
                          }
                  }
            },
  </code></pre>
  
  <p>All the bubbles now have 'NA' written inside them. So, I realize I am not doing it correctly. I want to know what does the 'value' contain in the formatter function. Will I be able to check its equality with the coordinates in the data? Please help.</p>
  
  <p>This is how the points look as of now:
  <a href="https://i.stack.imgur.com/leGLf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/leGLf.png" alt="Scatterplot"></a></p>
  
  <p><strong>PS: The value element in formatter function of label in series is always UNDEFINED</strong></p>