c3js / c3js/c3

Set dynamically extent of subchart

Open
#2,036 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

For now, you can set the extent for subchart like this:

`
c3.generate({
...
axis: {
x: {
extent: [1, 3]
}
}
...
subchart: {
show: true
}
}`

However, you can do it only at initialization. Can you make it editable on the runtime?
Something like:

`var chart = c3.generate({ ... });`
`chart.axis.extent({min: 1, max: 3}); //idea1`
`//chart.axis.extent(1, 3); //idea2 `

It could be similar to use like setting the range of axis (`chart.axis.range({min:1, max: 3});` ) which is already implemented.
Also, it would be nice to have an option to lock extent, so that the user can't change it, and then the subchart would be usable like scroll bar (user would be only able to move gray area on subchart).
Thoughts?

Best regards,
Sly

Contributor guide

Open the contributing guide

Research direction

Start with the existing chart.axis.range runtime API and the subchart extent option described in the issue. Compare the proposed chart.axis.extent signatures, then determine how the optional locked extent should interact with user movement of the subchart selection. Done means runtime extent changes work and a locked extent prevents user changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
d3js, javascript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.