Creating a file import plugin, need to set number format

Q&A for C, C++, and/or C# developers using DPlot

Moderator: DPlotAdmin

Post Reply
Gogeta70
Posts: 7
Joined: Tue Mar 05, 2013 12:08 pm

Creating a file import plugin, need to set number format

Post by Gogeta70 »

Hi, i'm creating a DPlot plugin to import a custom file format that is generated by another program i wrote. This program takes data from electrical meters that monitor amps and voltage over a period of time.

Basically, i need to generate a line graph that uses the Y axis as the voltage and amp values, and the X axis represents a period of time. I've read over the help file in DPlot regarding developing plugins as well as the plugin examples and the DPlot.h header file, however i haven't found anything that suggests i can set the number format for the X axis.

I did see that in the DPlot help file, it shows an lpszCommands string for the DPLOT structure, but i could not find that in the DPlot.h header file (which supports up to version 4).

Am i missing something here? DPlot is a great solution for what i need, but i have to be able to represent dates and times along the X axis.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Search the DPlot Help file for plugins then scroll near the bottom for the DPLOT structure.

This is different than the structure used by calls to DPLOTLIB.DLL, which I think may have caused some confusion... except that I just noticed I included the wrong DPLOT.H with the plugin examples, so it's no wonder you were confused! I'll fix this soon. In the meantime just copy the DPLOT structure from the Help file and you should be good to go.

The lpszCommands string should contain commands in the same syntax you'd use when calling DPlot_Command in another application. For example to set the number format on the X axis to date & time you'd use

"[NumberFormat(0,13)]"

You can string as many commands together as you want, up to 32K.

Let me know if you have any questions.
Visualize Your Data
support@dplot.com
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

I just replaced http://www.dplot.com/plugins.zip to include the correct header file. Sorry for the trouble.
Visualize Your Data
support@dplot.com
Gogeta70
Posts: 7
Joined: Tue Mar 05, 2013 12:08 pm

Post by Gogeta70 »

Perfect! Thank you.

One more question, just so i'm sure.

Say i write a plugin to import a file that has say, 3 curves. For the second curve, do write to X and Y[DPlot->MaxPoints], and for the third curve X and Y[DPlot-MaxPoints * 2]?
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Yes, that's correct.
Visualize Your Data
support@dplot.com
Gogeta70
Posts: 7
Joined: Tue Mar 05, 2013 12:08 pm

Post by Gogeta70 »

Thanks for all the help! I'm finally getting somewhere with all this now. :)
Post Reply