Skip to content

How is possible refresh the data in a anystock chart #1

@masalinas

Description

@masalinas

Actually I have:

inde.html

<div anystock
                             ac-title="Simple Candlestick"
                             ac-instance="stock"
                             style="width: 100%; height: 500px">
                        </div>

index.js:

// paint anystock graph
        var table = anychart.data.table();

        table.addData([
            ['2015-12-24', 511.53, 514.98, 505.79, 506.40],
            ['2015-12-25', 512.53, 514.88, 505.69, 507.34],
            ['2015-12-26', 511.83, 514.98, 505.59, 506.23],
            ['2015-12-27', 511.22, 515.30, 505.49, 506.47]
        ]);

        // mapping the data
        var mapping = table.mapAs();

        mapping.addField('open', 1, 'first');
        mapping.addField('high', 2, 'max');
        mapping.addField('low', 3, 'min');
        mapping.addField('close', 4, 'last');
        mapping.addField('value', 4, 'last');

        var chart = anychart.stock();

        // set the series type
        //chart.plot(0).ohlc(mapping).name('ACME Corp.');
        chart.plot(0).candlestick(mapping).name('ACME Corp.');

        $scope.stock = chart;

But how can i refresh the the stock chart already created with new data??

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions