chartjs/chartjs-chart-financial

mixed types

erikjonkers opened this issue · 6 comments

Hi,

I try to use mixed types:
https://www.chartjs.org/docs/latest/charts/mixed.html

But the 'type' value is dominant at a higher level;

var chart = new Chart(ctx, {
        type: "candlestick",
        data: {
            datasets: [{
                type: "candlestick",
                label: marketName,
                data: candleData
            }, {
                type: "line",
                label: supportLevel,
                data: lineData
            }
        }
    }
);

Looks fine to me, but could do with some coverage for this in the demo page.
(working with chartjs 3.2.1)

image

@CupcakeThief

Would you mind sharing your code? I'm also unable to get mixed types working.

Can't do that, as it's all in C#/Blazor, would be more confusing than helpful.

Instead I've twiddled the sample page, see pull request #97 which adds a line for close prices.

I've fixed tooltip labeling for mixed charts, under the same PR.

NB there's quite a big gotcha with financial plugin; parsing for datetime values is disabled by default, for performance.
Make sure you convert x values to epoch timestamps, e.g. as per demo page

x: luxon.DateTime.fromRFC2822(dateStr)

fixed by #97