ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  how to hidden legend box?
Posted by dennis.kim on Dec-14-2022 19:18
Attachments:
Hi,

I am implementing multichart using sample code.
I simply want to make the legendbox invisible.

There doesn't seem to be a function like hidden in the lib function.
how can i handle legend box hidden?

<------------------------ code ------------------------------>
    MultiChart* m = new MultiChart(780, 3 * chartHeight + xAxisHeight);

    m->addChart(0, 0, drawXYChart(viewer, m_dataSeriesA, "EV_V", 0xff0000, 0, false));
    Axis* xAxisScale = ((XYChart*)m->getChart(0))->xAxis();

    m->addChart(0, 15 + chartHeight, drawXYChart(viewer, m_dataSeriesB, "Measure_V", 0x00cc00, xAxisScale, false));

    m->addChart(0, 15 + chartHeight * 2, drawXYChart(viewer, m_dataSeriesC, "Measure_C", 0x0000ff,
        xAxisScale,  true));
<----------------------------------------------------------->
aaa.jpg

  Re: how to hidden legend box?
Posted by dennis.kim on Dec-14-2022 19:42
I found a way like below.

<-------------------- code ------------------------------->
m->addChart(0, 0, drawXYChart(viewer, m_dataSeriesA, "EV_V", 0xff0000, 0, false));
    Axis* xAxisScale = ((XYChart*)m->getChart(0))->xAxis();
    m->getChart(0)->getLegend()->setPos(1000,1000); // move legend out of window

    // All other charts synchronize their x-axes with that of the first chart.
    m->addChart(0, 15 + chartHeight, drawXYChart(viewer, m_dataSeriesB, "Measure_V", 0x00cc00,
        xAxisScale, false));
    m->getChart(1)->getLegend()->setPos(1000,1000); // move legend out of window


    // The last chart displays the x-axis.
    m->addChart(0, 15 + chartHeight * 2, drawXYChart(viewer, m_dataSeriesC, "Measure_C", 0x0000ff,
        xAxisScale,  true));
    m->getChart(2)->getLegend()->setPos(1000,1000); // move legend out of window
<--------------------------------------------------------->

Please let me know if there is another function other than this that is clearer.