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

change axis when loading new data dynamically #1258

Open
ghost opened this issue Jul 8, 2015 · 0 comments
Open

change axis when loading new data dynamically #1258

ghost opened this issue Jul 8, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 8, 2015

Hey guys,
So I am new to json but I have made some good progress.

So I am loading data into an area-spline with a timeseries as the x axis in the form of %Y-%m-%d as shown below

var chart = c3.generate({
bindto: '#missed-calls',
data: {
x: 'time',
type:"area-spline",
colors: {
missedcall: '#0000ff'
},
url: '',
mimeType: 'json',
names:{missedcall:"Missed calls"}
},
axis: {
x: {type: 'timeseries', tick:{format: '%Y-%m-%d'}}
}
});

I am then loading new data dynamically via json when there is a change in frequency, say weekly, monthly or daily as shown below

$("#dashboard-data").on("change",function(e)
{
missedcall_.load({
url: '/dashboard/recent_data/missed_calls/',
mimeType: 'json'
});
});

The x axis timeseries format hence becomes irrelevant as I need it to change from %Y-%m-%d to %m or something iike that..
I am loading the necessary data from json but I do not know how to effect the change of the x axis on the dynamically loaded data..

Where do I place this code to effect the new axis

axis: {
x: {type: 'timeseries', tick:{format: '%Y-%m-%d'}}
}
}

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

0 participants