How to set AnyChart Candlestick colors dynamic?
up vote
0
down vote
favorite
I want to set Candlestick Colors dynamically. But i don't know how.
So i passed the Parameter true as said on anychart Doc to anychart.stock
constructor und defined a field caled color on Dataset with mapped field
as example showed below.
Anyone get a Solutions ?
Ref to Dok: https://docs.anychart.com/Stock_Charts/Data#individual_point_settings
anychart.onDocumentReady(function() {
// create a data table
var table = anychart.data.table('x');
// add data
table.addData([{
'x': '2015-12-24',
'open': 511.53,
'high': 514.98,
'low': 505.79,
'close': 506.40,
'fill': '#00FF00'
}]);
// create a stock chart
var chart = anychart.stock(true);
// create a mapping
var mapping = table.mapAs({
'open': 'open',
'high': 'high',
'low': 'low',
'close': 'close',
'fill': 'fill'
});
// add a series using the mapping
chart.plot(0).candlestick(mapping).name('ACME Corp.');
// set container id for the chart
chart.container('container');
// initiate chart drawing
chart.draw();
});
javascript web candlestick-chart anychart
add a comment |
up vote
0
down vote
favorite
I want to set Candlestick Colors dynamically. But i don't know how.
So i passed the Parameter true as said on anychart Doc to anychart.stock
constructor und defined a field caled color on Dataset with mapped field
as example showed below.
Anyone get a Solutions ?
Ref to Dok: https://docs.anychart.com/Stock_Charts/Data#individual_point_settings
anychart.onDocumentReady(function() {
// create a data table
var table = anychart.data.table('x');
// add data
table.addData([{
'x': '2015-12-24',
'open': 511.53,
'high': 514.98,
'low': 505.79,
'close': 506.40,
'fill': '#00FF00'
}]);
// create a stock chart
var chart = anychart.stock(true);
// create a mapping
var mapping = table.mapAs({
'open': 'open',
'high': 'high',
'low': 'low',
'close': 'close',
'fill': 'fill'
});
// add a series using the mapping
chart.plot(0).candlestick(mapping).name('ACME Corp.');
// set container id for the chart
chart.container('container');
// initiate chart drawing
chart.draw();
});
javascript web candlestick-chart anychart
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to set Candlestick Colors dynamically. But i don't know how.
So i passed the Parameter true as said on anychart Doc to anychart.stock
constructor und defined a field caled color on Dataset with mapped field
as example showed below.
Anyone get a Solutions ?
Ref to Dok: https://docs.anychart.com/Stock_Charts/Data#individual_point_settings
anychart.onDocumentReady(function() {
// create a data table
var table = anychart.data.table('x');
// add data
table.addData([{
'x': '2015-12-24',
'open': 511.53,
'high': 514.98,
'low': 505.79,
'close': 506.40,
'fill': '#00FF00'
}]);
// create a stock chart
var chart = anychart.stock(true);
// create a mapping
var mapping = table.mapAs({
'open': 'open',
'high': 'high',
'low': 'low',
'close': 'close',
'fill': 'fill'
});
// add a series using the mapping
chart.plot(0).candlestick(mapping).name('ACME Corp.');
// set container id for the chart
chart.container('container');
// initiate chart drawing
chart.draw();
});
javascript web candlestick-chart anychart
I want to set Candlestick Colors dynamically. But i don't know how.
So i passed the Parameter true as said on anychart Doc to anychart.stock
constructor und defined a field caled color on Dataset with mapped field
as example showed below.
Anyone get a Solutions ?
Ref to Dok: https://docs.anychart.com/Stock_Charts/Data#individual_point_settings
anychart.onDocumentReady(function() {
// create a data table
var table = anychart.data.table('x');
// add data
table.addData([{
'x': '2015-12-24',
'open': 511.53,
'high': 514.98,
'low': 505.79,
'close': 506.40,
'fill': '#00FF00'
}]);
// create a stock chart
var chart = anychart.stock(true);
// create a mapping
var mapping = table.mapAs({
'open': 'open',
'high': 'high',
'low': 'low',
'close': 'close',
'fill': 'fill'
});
// add a series using the mapping
chart.plot(0).candlestick(mapping).name('ACME Corp.');
// set container id for the chart
chart.container('container');
// initiate chart drawing
chart.draw();
});
javascript web candlestick-chart anychart
javascript web candlestick-chart anychart
edited Nov 7 at 12:53
Gaspacchio
711218
711218
asked Nov 7 at 12:21
Nex Tronic
11
11
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Your approach was absolutely right! The only problem was that candlestick series has no 'fill' setting, it has risingFill and fallingFill. So, all you need is to map it using these settings. You can check the working sample based on your code in the comment below. Also, you can learn more about candlestick settings in this article.
playground.anychart.com/0LSrr297
– AnyChart Support
Nov 12 at 4:00
Thx you very much. Your Solution works perfektly! With the mapped Falling Fill, Rising Fill all work as expected for me.
– Nex Tronic
Nov 19 at 18:20
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Your approach was absolutely right! The only problem was that candlestick series has no 'fill' setting, it has risingFill and fallingFill. So, all you need is to map it using these settings. You can check the working sample based on your code in the comment below. Also, you can learn more about candlestick settings in this article.
playground.anychart.com/0LSrr297
– AnyChart Support
Nov 12 at 4:00
Thx you very much. Your Solution works perfektly! With the mapped Falling Fill, Rising Fill all work as expected for me.
– Nex Tronic
Nov 19 at 18:20
add a comment |
up vote
0
down vote
Your approach was absolutely right! The only problem was that candlestick series has no 'fill' setting, it has risingFill and fallingFill. So, all you need is to map it using these settings. You can check the working sample based on your code in the comment below. Also, you can learn more about candlestick settings in this article.
playground.anychart.com/0LSrr297
– AnyChart Support
Nov 12 at 4:00
Thx you very much. Your Solution works perfektly! With the mapped Falling Fill, Rising Fill all work as expected for me.
– Nex Tronic
Nov 19 at 18:20
add a comment |
up vote
0
down vote
up vote
0
down vote
Your approach was absolutely right! The only problem was that candlestick series has no 'fill' setting, it has risingFill and fallingFill. So, all you need is to map it using these settings. You can check the working sample based on your code in the comment below. Also, you can learn more about candlestick settings in this article.
Your approach was absolutely right! The only problem was that candlestick series has no 'fill' setting, it has risingFill and fallingFill. So, all you need is to map it using these settings. You can check the working sample based on your code in the comment below. Also, you can learn more about candlestick settings in this article.
answered Nov 12 at 4:00
AnyChart Support
1,4701511
1,4701511
playground.anychart.com/0LSrr297
– AnyChart Support
Nov 12 at 4:00
Thx you very much. Your Solution works perfektly! With the mapped Falling Fill, Rising Fill all work as expected for me.
– Nex Tronic
Nov 19 at 18:20
add a comment |
playground.anychart.com/0LSrr297
– AnyChart Support
Nov 12 at 4:00
Thx you very much. Your Solution works perfektly! With the mapped Falling Fill, Rising Fill all work as expected for me.
– Nex Tronic
Nov 19 at 18:20
playground.anychart.com/0LSrr297
– AnyChart Support
Nov 12 at 4:00
playground.anychart.com/0LSrr297
– AnyChart Support
Nov 12 at 4:00
Thx you very much. Your Solution works perfektly! With the mapped Falling Fill, Rising Fill all work as expected for me.
– Nex Tronic
Nov 19 at 18:20
Thx you very much. Your Solution works perfektly! With the mapped Falling Fill, Rising Fill all work as expected for me.
– Nex Tronic
Nov 19 at 18:20
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53189389%2fhow-to-set-anychart-candlestick-colors-dynamic%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown