String Handling in Highcharts (5)
string as the Y value
Because Highcharts does not support string as the Y value, nor does it resolve the name of the node to the y-axis, it can only be converted by instance 2-9.
"Instance 2-10:strdatay" generates a chart of a student's score table, as shown in table 2.3. Where the X value is the number of exams, and the result is the Y value.
Table 2.3 Test results of a classmate
The core code is as follows:
- Series: [{
- Data: [2, 1, 3, 2,3]//convert string to scale value
- }],
- YAxis: [{
- Type: ' Category ',
- categories:[' fail ', ' pass ', ' good ', ' good ']//Specify the scale
- }],
- Xaxis: [{
- Type: ' Category ',
- categories:[' first time ', ' second ', ' third ', ' fourth ', ' fifth time '
- }],
After executing the code, the effect.
The Y value is a string
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
String Handling in Highcharts (5)