Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor chart functions + 3 new charts #149

Open
wants to merge 5 commits into
base: pr/137
Choose a base branch
from
Open

Refactor chart functions + 3 new charts #149

wants to merge 5 commits into from

Conversation

chaosfinity
Copy link

Here's another big one, the diff makes my head hurt.

And the list:

  • Pulled default colors into the provider to allow application level override
  • Commented all new functions in the provider
  • Refactored repeated code into helper functions
  • Created a getGraph() function to create graph type charts

getGraph() example

//Create your Axes
var x = d3.scale.ordinal()
  .domain(['Label', 'Label'])
  .rangePoints([0, 1])
;
var y = d3.scale.linear()
  .range([1,0])
  .domain([0,1])
;
// fetch the Graph
var graph = acChartLogicProvider.getGraph(config, box, x, y, horizontal);
//Returns
graph = {
  xAxis, // d3.svg.axis()
  yAxis, // d3.svg.axis()
  svg, //Chart svg
  xAxisSelection, //Selection for drawn xAxis
  yAxisSelection //Selection for drawn yAxis
}

I'll begin working on documentation for the provider API as soon as this is decided on

Christopher Scott added 4 commits September 24, 2014 11:11
Rename service to acChartLogicProvider to increase semantics
Moved default colors to provider and made getter/setter functions
Made tests for color getter/setter
Fix default legend function for line chart
Normalize Graph type charts by offering a getGraph function
Change getGraph to include a horizontal option
Add function to adjust left margin to horizontal chart labels
Add function to get list of charts available
Changed examples to fetch available charts and create the selectable list
Rotate xAxis labels now uses positive and negative numbers the same way, to rotate away from the graph
@chaosfinity
Copy link
Author

Added 3 new charts, bar-stacked, slab, and slab-stacked.
Updated the getGraph() function to work with horizontal graphs
Changed xAxisLabelRotation to use positive or negative numbers the same way

What else needs to be done to get these updates into a release?

@chaosfinity
Copy link
Author

About stacked charts:
Stacked chart labels are hidden if they do not fit within the section

@chaosfinity chaosfinity changed the title Refactor chart functions Refactor chart functions + 3 new charts Sep 28, 2014
Updated tests to accomodate new element structure for line/point charts
Update width/height error to only check for that error and not any error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant