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

Tick Formatting #17

Open
lfarrell opened this issue Aug 29, 2014 · 3 comments
Open

Tick Formatting #17

lfarrell opened this issue Aug 29, 2014 · 3 comments

Comments

@lfarrell
Copy link

Thanks for a great library. I've figured out most of what I've needed to do from the examples and just playing around. However I was wondering if tick formatting was possible. In regular dc.js you can do something like this to format the axis:

var axis_format = d3.time.format("%x");
over_time.width(1050)
.height(350)
.dimension(times)
.group(time_counts)
.xAxis().tickFormat(function(d) { return axis_format(d); });

However, I can't seem to work out specifying axis and format with angular-dc.

Thanks,
Dean

@TomNeyland
Copy link
Owner

@lfarrell The work-around described in #15 should also work for this case.

As I say in that issue, the work-around is a bit inelegant, this sounds like another good use case for a nestable directive.

@lfarrell
Copy link
Author

lfarrell commented Sep 4, 2014

Thanks, would this apply to the choropleth chart as well? I can't seem to come up with any sane way to add the required overlay option:
overlayGeoJson(json, name, keyAccessor) - mandatory

I've been trying this in a renderlet, but it doesn't render:

renderlet: function(chart){
chart.colorCalculator(function (d) { return d ? chart.colors()(d) : '#ccc'; });
chart.overlayGeoJson(m.features, "state", function(d) {
return d.properties.name;
});

                }

@lfarrell
Copy link
Author

lfarrell commented Sep 4, 2014

Answered my own question. This does work:
$scope.postMapSetup = function(chart) {
chart.colorCalculator(function (d) { return d ? chart.colors()(d) : '#ccc'; });
chart.overlayGeoJson(m.features, "state", function(d) {
return d.properties.name;
});
};

Thanks for a cool library. It's saved me a lot of work. 👍

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

No branches or pull requests

2 participants