Jump to content
Software FX Community

Possible to Reverse X-Axis?


User (Legacy)

Recommended Posts

I am using ChartFX.NET 6.2 and have attached the chart that we are working

on.. the user has just come up with a new request... we are currently

plotting 24 hours worth of information and it is charting it as I would have

expected it to with the most recent data to the right of the chart. The

user though would like to have the most recent data displayed at the left of

the chart. Is this possible? I have reversed the SQL statement so that it

pulls the dataset back in the reverse order but it is charting it the same.

Thanks,

Derek

Link to comment
Share on other sites

Well that is doing what I wanted but it did a couple of other things that I

was not anticipating..

1. It moved the Y Axis labels to the right - I would like those to stay on

the left

2. I lost all of my hour markers on the X Axis

Here is the code dealing with the axis:

Chart Chart1 = new Chart(this);

Chart1.AxisY.ForceZero = false;

Chart1.AxisX.LabelAngle = 45;

Chart1.AxisX.LabelValue = 1;

Chart1.AxisX.Inverted = true;

Chart1.AxisX.Step = 1/24.0;

Chart1.AxisX.LabelsFormat.CustomFormat = "HH:mm";

Thanks again!

Derek

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:hbBg84KHEHA.788@webserver3.softwarefx.com...

> What you need to do is:

>

> chart.AxisX.Inverted = true;

>

> --

> FP

> Software FX

>

>

Link to comment
Share on other sites

> 1.  It moved the Y Axis labels to the right - I would like those to stay

on

> the left

Yes this is by design. The Y-Axis will be wherever Zero is. To move it to

the other side:

chart.AxisY.Position = AxisPosition.Far;

> 2. I lost all of my hour markers on the X Axis

I think you are experiencing a bug that was fixed some time ago. Please

download the latest SP from our support site. If the problem persists,

please export the chart to a binary file (using the Export method) and

attach it in your next posting.

--

FP

Software FX

post-2107-13922365935351_thumb.png

post-2107-13922377124714_thumb.png

Link to comment
Share on other sites

I used the service pack detection tool on your web site and from what I can

tell I am current with the product.

Here is my current set of VB.NET code... I just switched from C# to VB.NET

today..

Chart1 = new Chart()

Chart1.AxisY.ForceZero = false

Chart1.AxisX.LabelAngle = 45

Chart1.AxisX.LabelValue = 1

Chart1.AxisX.Inverted = true

Chart1.AxisY.Position = AxisPosition.Far

Chart1.AxisX.Step = 1/24.0

Chart1.AxisX.LabelsFormat.CustomFormat = "HH:mm"

Chart1.Gallery = Gallery.Lines

Chart1.Series(0).MarkerShape = MarkerShape.None

Title = Chart1.Titles(0)

Title.Alignment = StringAlignment.Center

Title.Font = new Font("Arial",16,FontStyle.Bold)

Title.Text = "Maloney Reservoir, " & strDisplayDate & ", Current Reading

" & FormatNumber(strLatestData,2)

Title.TextColor = Color.Brown

Chart1.AxisX.Title.Text = "Time"

Chart1.AxisY.Title.Text = "Elevation (Feet)"

Chart1.DataSource = dsSales.Tables(0)

Response.Write(Chart1.GetHtmlTag("1000","400","image"))

with this line in the mix:

Chart1.AxisX.Inverted = true

I lose the hourly markers at the bottom of the chart (Maloney1.png) - with

it out I have them but the XAxis is opposite of what we are wanting

(Maloney2.png).

As far as giving you a binary file....

I have been attempting to add this line to the bottom of the ASPX page:

Chart1.Export(SoftwareFX.ChartFX.FileFormat.Binary, "C:\\chart1.bin")

but it keeps giving me this error:

Compiler Error Message: BC30456: 'FileFormat' is not a member of 'ChartFX'.

Source Error:

Line 69: Chart1.DataSource = dsSales.Tables(0)

Line 70: Response.Write(Chart1.GetHtmlTag("1000","400","image"))

Line 71: Chart1.Export(SoftwareFX.ChartFX.FileFormat.Binary,

"C:\\chart1.bin")

Line 72: %>

Thanks again for all of your support!

Derek

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:EkJtDOLHEHA.2848@webserver3.softwarefx.com...

> > 1. It moved the Y Axis labels to the right - I would like those to stay

> on

> > the left

> Yes this is by design. The Y-Axis will be wherever Zero is. To move it to

> the other side:

>

> chart.AxisY.Position = AxisPosition.Far;

>

> > 2. I lost all of my hour markers on the X Axis

>

> I think you are experiencing a bug that was fixed some time ago. Please

> download the latest SP from our support site. If the problem persists,

> please export the chart to a binary file (using the Export method) and

> attach it in your next posting.

>

> --

> FP

> Software FX

>

>

Link to comment
Share on other sites

Try:

Chart1.Export(SoftwareFX.ChartFX.Internet.Server.FileFormat.Binary,

"C:\\chart1.bin");

NOTE: Since this is an ASP.NET page, the permissions the Web user has may

cause an exception when writing to this file. Make sure you write to a

location for which the Web user has WRITE permissions.

--

FP

Software FX

Link to comment
Share on other sites

Thanks!

Here is the binary file.

- Derek

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:In%235elOHEHA.2848@webserver3.softwarefx.com...

> Try:

>

> Chart1.Export(SoftwareFX.ChartFX.Internet.Server.FileFormat.Binary,

> "C:\\chart1.bin");

>

>

>

> NOTE: Since this is an ASP.NET page, the permissions the Web user has may

> cause an exception when writing to this file. Make sure you write to a

> location for which the Web user has WRITE permissions.

>

>

> --

> FP

> Software FX

>

>

Link to comment
Share on other sites

The file you sent me looks perfect for me (see attached file).

I tried generating both image and .NET component. Which one are you using ?

Also, make sure you are using the latest version in your app, you may have

downloaded the SP from our support site but maybe you didn't re-build your

application so that the new server-side dll's would be copied to your

application's bin folder.

Check the file version of chartfx.internet.dll in your app's bin folder.

--

FP

Software FX

Link to comment
Share on other sites

Yeah - your file looks a lot better than mine!  =:-)

I have a chartfx.internet.dll with a date of 3/19/2004 592kb located in my

applications /bin folder. Does that sound like the right date?

- Derek

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:AQK3NVXHEHA.2848@webserver3.softwarefx.com...

> The file you sent me looks perfect for me (see attached file).

>

> I tried generating both image and .NET component. Which one are you using

?

>

> Also, make sure you are using the latest version in your app, you may have

> downloaded the SP from our support site but maybe you didn't re-build your

> application so that the new server-side dll's would be copied to your

> application's bin folder.

>

> Check the file version of chartfx.internet.dll in your app's bin folder.

>

> --

> FP

> Software FX

>

>

>

Link to comment
Share on other sites

While working on the other Legend issue I moved the binding of the data to

the chart in my code to immediately after I create the chart object. Once I

did that it took care of the legend issue as well as the hourly values on

the X Axis! The chart looks perfect now!

Thanks again for all of your help!

Derek

"Derek Feagin" <ddfeagi@nppd.com> wrote in message

news:iO2t3fXHEHA.788@webserver3.softwarefx.com...

> Yeah - your file looks a lot better than mine! =:-)

>

> I have a chartfx.internet.dll with a date of 3/19/2004 592kb located in my

> applications /bin folder. Does that sound like the right date?

>

> - Derek

>

>

> "SoftwareFX Support" <noreply@softwarefx.com> wrote in message

> news:AQK3NVXHEHA.2848@webserver3.softwarefx.com...

> > The file you sent me looks perfect for me (see attached file).

> >

> > I tried generating both image and .NET component. Which one are you

using

> ?

> >

> > Also, make sure you are using the latest version in your app, you may

have

> > downloaded the SP from our support site but maybe you didn't re-build

your

> > application so that the new server-side dll's would be copied to your

> > application's bin folder.

> >

> > Check the file version of chartfx.internet.dll in your app's bin folder.

> >

> > --

> > FP

> > Software FX

> >

> >

> >

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...