This week I worked on two major issues:
The second issue was a little complex. Direct plotting of strings is not well supported in Highcharts, it is usually through 'categories' option of xAxis/yAxis. The data points are plotted corresponding to each of category values in this case. In our case, a field may have duplicates so in categories, the labels are repeated on the axes. So instead of using categories I assigned each distinct string (for a field) an integer value (eg. 1,2,3...), mapped the corresponding string values to integer values and formatted the labels to show the string values instead of the integer map. This helped to solve the following issues:
- Changing the display of the data point content from a form based interface to a dialog based display.
- Providing support for plotting of other data-types like strings.
The second issue was a little complex. Direct plotting of strings is not well supported in Highcharts, it is usually through 'categories' option of xAxis/yAxis. The data points are plotted corresponding to each of category values in this case. In our case, a field may have duplicates so in categories, the labels are repeated on the axes. So instead of using categories I assigned each distinct string (for a field) an integer value (eg. 1,2,3...), mapped the corresponding string values to integer values and formatted the labels to show the string values instead of the integer map. This helped to solve the following issues:
- Duplicate labels in the axes are removed (as opposed to categories)
- Can now plot them as simple integer values
- In addition to above sorting the array containing the distinct values (inbuilt sort for now) solves the issue where we have a large number of labels and their text get mixed up. What happens now is like integer labels some divisions are created on the axes and when we zoom in the divisions get smaller and labels within that division are show.
No comments:
Post a Comment