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

Highcharts #19

Open
awb99 opened this issue Dec 14, 2023 · 7 comments
Open

Highcharts #19

awb99 opened this issue Dec 14, 2023 · 7 comments

Comments

@awb99
Copy link
Collaborator

awb99 commented Dec 14, 2023

yAxis: [{
height: '50%',
resize: {
enabled: true
}
}, {
height: '50%',
top: '50%'
}]

@awb99
Copy link
Collaborator Author

awb99 commented Dec 14, 2023

To use the axis resizer it is required to include the module modules/drag-panes.js, or js/modules/drag-panes.js if you are using styled mode.

@awb99
Copy link
Collaborator Author

awb99 commented Dec 14, 2023

(async () => {

const data = await fetch(
    'https://demo-live-data.highcharts.com/aapl-ohlcv.json'
).then(response => response.json());

// split the data set into ohlc and volume
const ohlc = [],
    volume = [],
    dataLength = data.length,
    // set the allowed units for data grouping
    groupingUnits = [[
        'week',                         // unit name
        [1]                             // allowed multiples
    ], [
        'month',
        [1, 2, 3, 4, 6]
    ]];

for (let i = 0; i < dataLength; i += 1) {
    ohlc.push([
        data[i][0], // the date
        data[i][1], // open
        data[i][2], // high
        data[i][3], // low
        data[i][4] // close
    ]);

    volume.push([
        data[i][0], // the date
        data[i][5] // the volume
    ]);
}

// create the chart
Highcharts.stockChart('container', {

    rangeSelector: {
        selected: 4
    },

    title: {
        text: 'AAPL Historical'
    },

    yAxis: [{
        labels: {
            align: 'right',
            x: -3
        },
        title: {
            text: 'OHLC'
        },
        height: '60%',
        lineWidth: 2,
        resize: {
            enabled: true
        }
    }, {
        labels: {
            align: 'right',
            x: -3
        },
        title: {
            text: 'Volume'
        },
        top: '65%',
        height: '35%',
        offset: 0,
        lineWidth: 2
    }],

    tooltip: {
        split: true
    },

    series: [{
        type: 'candlestick',
        name: 'AAPL',
        data: ohlc,
        dataGrouping: {
            units: groupingUnits
        }
    }, {
        type: 'column',
        name: 'Volume',
        data: volume,
        yAxis: 1,
        dataGrouping: {
            units: groupingUnits
        }
    }]
});

})();

@awb99
Copy link
Collaborator Author

awb99 commented Mar 18, 2024

Remove :box from ui-highcharts. Instead add class and style property. to options. This is to better control styling.

@awb99
Copy link
Collaborator Author

awb99 commented Mar 18, 2024

Chart-spec will generate the following sizes:

Only main chart: 100%
One extra chart: 80% 20%
2 extra charts: 80% 20% 20% => second bottom.chart needs scrolling!

@awb99
Copy link
Collaborator Author

awb99 commented Mar 18, 2024

chart.zoomType decides the dimensions by which the user can zoom by dragging the mouse. The possible values for this are x, y or xy.

var chart = {
zoomType: 'x'
};

chart.xAxis[0].setExtremes(1327449600000,1422144000000, false)
chart.yAxis[0].setExtremes(10, 20)

Highcharts.setOptions({
global: {
useUTC: false
}

time: {
timezone: 'America/New_York'
},

@awb99
Copy link
Collaborator Author

awb99 commented Mar 21, 2024

Timezone UTC
Pointplot with filter.
Csv loader. Goldly.

@awb99
Copy link
Collaborator Author

awb99 commented Mar 28, 2024

Line-plot:
Animation: false
step: "left", "center", "right”
Dashstyle
Solid
Dot
ShortDot
Dash
ShortDash
LongDash

DashDot
ShortDashDot
LongDashDot

LongDashDotDot
ShortDashDotDot

:lineWidth: number
Pixel width of the graph line.
Defaults to 2.
:marker

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

1 participant