Home > Mobile >  Android WebView integrated eCharts, functions, is added in the formatter eCharts don't show
Android WebView integrated eCharts, functions, is added in the formatter eCharts don't show

Time:09-19

Add: Android option. The tooltip (). The trigger (trigger. The axis). The formatter (" (the function () {return 'Temperature: & lt; br/> Km: {b} {c} % '; }) () "); , copy print log in your browser or the normal display
And the option. The tooltip (). The trigger (trigger. The axis). The formatter (" (the function () {return 'Temperature: & lt; br/> Km: {b} {c} % '; }) () "); Commented out, can, according to
Or change to the option. The tooltip (). The trigger (trigger. The axis). The formatter (" Temperature: & lt; br/> Km: {b} {c} % ");

CodePudding user response:

Public static GsonOption getLineChartOptions () {

Object [] xAxis=new Object [] {" Monday ", "Tuesday", "on Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};

Object [] lineName=new Object [] {" email marketing ", "advertising", "video ads", "direct access"};

Object [] data1=new Object [] {120, 132, 101, 134, 90, 230, 210};
Object [] data2=new Object [] {220, 182, 191, 234, 290, 330, 310};
Object [] data3=new Object [] {150, 232, 201, 154, 190, 330, 410};
Object [] data4=new Object [] {320, 332, 301, 334, 390, 330, 320};

GsonOption option=new GsonOption ();
//title
//option. The title (" line chart ");
//illustration
Option. Legend (lineName);

//Tooltip Tooltip=new Tooltip ();
//tooltip. The trigger (trigger. The axis);
//tooltip. The formatter (" {a} {b}, {c} ({d} %) ");
////tooltip. The formatter (" {a0}, {c0} ");
//option. SetTooltip (tooltip);
//click the line chart shows the specific content of: tip

//option. The tooltip (). The trigger (trigger. The axis). The formatter (" (the function () {return 'Temperature: & lt; br/> Km: {b} {c} ° c '; }) () ");
Option. The tooltip (). The trigger (trigger. The axis). The formatter (" Temperature: & lt; br/> Km: {b} {c} ° c ");

ValueAxis ValueAxis=new ValueAxis ();
Option. YAxis (valueAxis);

CategoryAxis categorxAxis=new CategoryAxis ();
CategorxAxis. AxisLine (.) onZero (false);
//categorxAxis. AxisLabel (). The formatter (" (the function () {new Date (). ToLocaleTimeString (' Chinese '} {hour12: false); }) () ");
CategorxAxis. BoundaryGap (true);
CategorxAxis. Data (xAxis);
Option. XAxis (categorxAxis);

Line, line1=new Line ();
, line1. Smooth (true). The name (" email marketing "). The data (data1). ItemStyle (). The normal () graphics.linestyle (). The shadowColor (" rgba (0,0,0,0.4) ");

The Line line2=new Line ();
Line2. Smooth (true). The name (" advertising "). The data (data2). ItemStyle (). The normal () graphics.linestyle (). The shadowColor (" rgba (0,0,0,0.4) ");

The Line line3=new Line ();
Line3. Smooth (true). The name (" video advertising "). The data (data3). ItemStyle (). The normal () graphics.linestyle (). The shadowColor (" rgba (0,0,0,0.4) ");

The Line line4=new Line ();
Line4. Smooth (true). The name (" direct access "). The data (data4). ItemStyle (). The normal () graphics.linestyle (). The shadowColor (" rgba (0,0,0,0.4) ");

Option. The series (, line1 and line2, line3 and line4.);

The return option;
}
  • Related