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

Message ListMessage List     Post MessagePost Message

  Areal Line Chart - hide X-axis top & Y-axis right side lines
Posted by Dharm on Feb-09-2023 07:36
Hi Team,

I am building Areal Line chart and I wanted to show only two sides of line on Axis.
X-axis and Y-axis where chart has value, And wanted to hide X-axis top & Y-axis right side line.

In attached image I have colored yellow.

And I wanted to increate the X-axis tick distance, so my x-axis text and X-axis has some distance.


Thanks,
Dharm

  Re: Areal Line Chart - hide X-axis top & Y-axis right side lines
Posted by Dharm on Feb-09-2023 07:40
Here I have attached image with output chart, I have highlighted yellow lines, which I wanted to hide.

  Re: Areal Line Chart - hide X-axis top & Y-axis right side lines
Posted by Dharm on Feb-09-2023 07:41
here is the Expected lines and X-axis value distance to show text.

  Re: Areal Line Chart - hide X-axis top & Y-axis right side lines
Posted by Peter Kwan on Feb-09-2023 16:46
Hi Dharm,

For some reasons, I cannot see your attached image.

To attach an image, in Upload Attachment, after choosing the image filename, you need to press the "Send File" button to upload the file. Also, there is a size limit of 250K bytes per file. If you image is larger than 250K bytes, you may need to reduce it to less than 250K bytes.

Sometimes saving the image in JPG can reduce the file size (open the image in Windows Photos or Windows Paint, then save as JPG). If it is still too large, you may need to resize the image first.

Best Regards
Peter Kwan

  Re: Areal Line Chart - hide X-axis top & Y-axis right side lines
Posted by Peter Kwan on Feb-09-2023 16:54
Hi Dharm,

In the original Area Line Chart sample code, there is no top x-axis or right y-axis, so it already met your requirements.

https://www.advsofteng.com/doc/cdnet.htm#arealine.htm

In general, ChartDirector will only draw axis that has data. If you can see the top x-axis and right y-axis, is it possible your code have used the axes or your line or area layers are using the right y-axis (calling setUseYAxis2)?

You can use Axis.setLabelGap to control the distance between the axis labels and the axis ticks. See:

https://www.advsofteng.com/doc/cdnet.htm#Axis.setLabelGap.htm

For example:

c.xAxis().setLabelGap(10);

Best Regards
Peter Kwan

  Re: Areal Line Chart - hide X-axis top & Y-axis right side lines
Posted by Dharm on Feb-09-2023 19:19
Thanks for reply,

In original line chart don't have line on any side, while we need on two sides and don't need on two sides

   |
   |
   |
   ---------------

We need lines two sides as per above dotted lines, in actual we need solid line I just show you for providing details.

And I am trying to upload .png and .jpg file type less than 60KB but still system shows some error and I am not able to find what error I am getting on file upload.


Thanks,
Dharm

  Re: Areal Line Chart - hide X-axis top & Y-axis right side lines
Posted by Peter Kwan on Feb-09-2023 23:34
Hi Dharm,

The plotarea should be surrounded by the plot area border on 4 sides. After that, the sides that have visible axes should have a line filled with the axis color.

In the original Area Line Chart, the plot area border color and the axis line color are both set to Chart.Transparent with the following lines:

// The plot area border is transparent
c.setPlotArea(70, 70, 540, 320, -1, -1, Chart.Transparent, 0xcccccc);

// Set the x and y axis stems to transparent, and the x-axis tick color to grey
// (0xaaaaaa)
c.xAxis().setColors(Chart.Transparent, Chart.TextColor, Chart.TextColor, 0xaaaaaa);
c.yAxis().setColors(Chart.Transparent);

For your case, you can keep the plot area border transparent, and set the axis stem color to 0x000000 instead of Chart.Transparent.

For the JPG/PNG, may be you can email to me at pkwan@advsofteng.net

Best Regards
Peter Kwan