DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

label on x axis using DPLOTLIB.DLL

 
Post new topic   Reply to topic    DPlot Forum Index -> C, C++, C#
View previous topic :: View next topic  
Author Message
Mad2Max



Joined: 03 Jan 2007
Posts: 16

PostPosted: Wed Jan 03, 2007 9:42 am    Post subject: label on x axis using DPLOTLIB.DLL Reply with quote

Hi,
I'd like to make a graph using dPlot Jr just like it happens using example.xls -> BarChart -> BarChart(label, Y1, Y2) and so getting label on X axis ... is it possible using dplotlib.dll? If yes, can you give me a hint?
Is it possible to have label on X axis using not barchart but "standard" xyplot?

Thanks and regards,
Max
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Wed Jan 03, 2007 10:27 am    Post subject: Reply with quote

Quote:
I'd like to make a graph using dPlot Jr just like it happens using example.xls -> BarChart -> BarChart(label, Y1, Y2) and so getting label on X axis ... is it possible using dplotlib.dll?


Yes. (FYI the Add-In uses DPLOTLIB.DLL, so anything it does you can also do programmatically.)

Quote:
If yes, can you give me a hint?


The best hint is to take a look at Sub BarChart() in the Add-In to see what it does. In Excel select Tools>Macro>Visual Basic Editor. In the Project pane click on "dplotlib (DPLOTLIB.XLA)". You'll be prompted for a password; use "dplot" without the quotes. Under "dplotlib (DPLOTLIB.XLA)" click the plus sign next to Modules, then double-click "DPlotData" and search for "Sub BarChart".

The numbers on the X axis are turned off with

Code:
cmds = cmds & "[NumberFormat(0," & Str$(NF_NONE) & ")]"


Labels are added a bit below that line with an XYLabel command:

Code:
cmds = cmds & "[XYLabel(" & Str$(k + 0.5) & ",0,0," & Chr$(34) & label & Chr$(34) & ")]"


Quote:
Is it possible to have label on X axis using not barchart but "standard" xyplot?


Yes, there's no difference. Just use a different ScaleCode. In the BarChart routine you'll notice that the labels are offset from the X value associated with the bar (Str$(k + 0.5)) so that the labels are centered on the bar rather than the left side of the bar. For other scale types you'll probably not want that offset.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mad2Max



Joined: 03 Jan 2007
Posts: 16

PostPosted: Fri Jan 05, 2007 11:01 am    Post subject: Reply with quote

Thanks a lot!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> C, C++, C# All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group