adrianhajdin / project_syncfusion_dashboard

This is a code repository for the corresponding YouTube video. In this tutorial we are going to build and deploy a an admin dashboard app using React.js and Syncfusion
https://jsmastery.pro
GNU Affero General Public License v3.0
3.04k stars 1.05k forks source link

Financial chart doesn't work #20

Closed doums10 closed 1 year ago

doums10 commented 1 year ago

It's the Financial Component here, I can't see the hilo line on the chart. Is anyone can help please?

import {
    ChartComponent,
    SeriesCollectionDirective,
    SeriesDirective,
    HiloSeries,
    Tooltip,
    DateTime,
    Zoom,
    Logarithmic,
    Crosshair,
    Inject,
} from "@syncfusion/ej2-react-charts";
import {
    financialChartData,
    FinancialPrimaryXAxis,
    FinancialPrimaryYAxis,
} from "../../data/dummy";
import { useStateContext } from "../../contexts/ContextProvider";
import { ChartsHeader } from "../../components";

const date1 = new Date("2017, 1, 1");

function filterValue(value) {
    if (value.x >= date1) {
        return value.x, value.high, value.low;
    }
}
const returnValue = financialChartData.filter(filterValue);

const Financial = () => {
    const { currentMode } = useStateContext();
    return (
        <div className="m-4 md:m-10 mt-24 p-10 bg-white dark:bg-secondary-dark-bg rounded-3xl">
            <ChartsHeader category="Financial" title="AAPL Historical" />
            <div className="w-full">
                <ChartComponent
                    id="charts"
                    crosshair={{ enable: true, lineType: "Vertical", line: { width: 0 } }}
                    primaryXAxis={FinancialPrimaryXAxis}
                    primaryYAxis={FinancialPrimaryYAxis}
                    chartArea={{ border: { width: 0 } }}
                    background={currentMode === "Dark" ? "#33373E" : "#fff"}
                    style={{ textAlign: "center" }}
                    tooltip={{ enable: true, shared: true }}
                >
                    <Inject
                        services={[
                            HiloSeries,
                            Tooltip,
                            DateTime,
                            Zoom,
                            Logarithmic,
                            Crosshair,
                        ]}
                    />
                    <SeriesCollectionDirective>
                        <SeriesDirective
                            datasource={returnValue}
                            type="Hilo"
                            xName="x"
                            low="low"
                            high="high"
                            name="Apple Inc"
                            yName="low"
                        />
                    </SeriesCollectionDirective>
                </ChartComponent>
            </div>
        </div>
    );
};

export default Financial;
Capture d’écran 2022-09-22 à 17 24 48
doums10 commented 1 year ago

I see datasource, its dataSource that I had to write.I close the issue