Quartz / Chartbuilder

A front-end charting application that facilitates easy creation of simple beautiful charts
http://quartz.github.io/Chartbuilder
MIT License
2.1k stars 354 forks source link

Squashing all of the auto-typing and numeric axis stuff, closes #159 #217

Closed yanofsky closed 8 years ago

yanofsky commented 8 years ago

This pull changes the way that A. data is parsed and B. adds the ability to have numeric xAxes.

A. Where you'd have to specify "date" or "year" in the first cell of your data for Chartbuilder to cast your data as a timeseries now Chartbuilder just tries to guess at first and allows you to specify if you want something different or it gets it wrong. The logic is as follows:

  1. If there is a specifed data type, parse the data as that data type and be done
  2. If their is no specified data type test if the first column successfully parses as numbers
  3. If the first column doesn't parse as numbers, test if it parses as dates
  4. If the first column successfully auto-parsed as numbers but the range of those numbers is between 1500 and 3000 reparse as dates
  5. If the first column doesn't parse as dates or numbers leave as strings

B. When you now specify your data as being numeric or the data is determined to be numeric by the logic above the xAxis will become a linear scale and the interface to adjust the parameters of that axis will appear in the editor. You can adjust the max, min, number of ticks and precision of the axis as well as add a prefix and suffix to label it. Currently the automatic spacing and tick value selection of the xAxis is non existent. There are also no mobile overrides presently.