Q6001007. How can I plot charts with an unequal number of points per series?

The information on this article applies to
Summary
This article will explain how to create a chart when one series is longer than the other, or there is missing data in the middle.

Description
If you are binding data from a DataSet (or directly from the table) ChartFX sets the AllocHidden flag by default, which will set any missing data to the Chart.Hidden enumeration. But, if you are using the API to pass data by assigning the Value and XValue properties you will need to set the AllocHidden flag manually when you open the data communication channel, as follows:

With Chart1
            .OpenData(COD.Values Or COD.AllocHidden, 2, 5)
            .OpenData(COD.XValues Or COD.AllocHidden, 2, 5)

            'the first series is missing some data in the middle
            .XValue(0, 0) = 0.86
            .Value(0, 0) = 0.41
            .XValue(0, 1) = 0.77
            .Value(0, 1) = 0.24
            
            .XValue(0, 3) = 0.55
            .Value(0, 3) = 0.16
            .XValue(0, 4) = 0.49
            .Value(0, 4) = 0.08

            'the second series only has 3 points
            .XValue(1, 0) = 0.12
            .Value(1, 0) = 0.08
            .XValue(1, 1) = 0.23
            .Value(1, 1) = 0.05
            .XValue(1, 2) = 0.34
            .Value(1, 2) = 0.02
           

            .CloseData(SoftwareFX.ChartFX.COD.XValues)
            .CloseData(SoftwareFX.ChartFX.COD.Values)
        End With

Related Articles
Q6001006 How can I customize my point labels to appear on certain points only?
Q6001011 I have a calculated column on my dataset. I don't want this column to be graphed but I do want it to show up in the dataeditor.
Q6001041 How to add additional points or series to the chart
Q6002072 Last character cut off in series legend box when printing chart
Q6002126 Setting BorderColor for ‘All Series’ using the run-time property dialog is ignored
Q6002164 Problems With Curve Charts


ArticleID:Q6001007
Keywords:
Reviewed:7/11/2002 10:38:00 AM

DISCLAIMER INFORMATION:
Information in this document is subject to change without notice and does not represent a commitment on the part of Software FX, Inc. The software, which includes the information contained in any databases, described in this document is furnished under a license agreement or nondisclosure agreement. The software may be used or copied only in accordance with the terms of those agreements. It is against the law to copy the software on any medium except as copy of the software for backup purposes. No part of this article may be reproduced or transmitted in any form or by any means including recording, or information storage and retrieval systems, for any purpose other than the purchaser's personal use, without the express written permission of Software FX, Inc.

Software FX, Inc. disclaim all warranties, either express or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, with respect to the instructions contained in this article.

In no event shall Software FX, Inc. be liable for any damages whatsoever including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss, even if Software FX, Inc. has been advised of the possibility of such damages. Because some states do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.