Hiding the first tick on the primary x-axis of the 2D bar chart


Author
Message
Andre Van Wyk
Andre Van Wyk
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)
Group: Forum Members
Posts: 4, Visits: 1
Here is the solution given to me by Nevron:

using System;
using System.Drawing;
using System.Windows.Forms;
using Nevron;
using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.ReportingServices;

namespace MyNamespace
{
///
/// Sample class
///

public class MyClass
{
///
/// Main entry point
///

///
public static void RSMain(NRSChartCodeContext context)
{
NChart chart = context.Document.Charts[0];

NAxis axis = chart.Axis(StandardAxis.PrimaryX);
NOrdinalScaleConfigurator ordinalScale = axis.ScaleConfigurator as NOrdinalScaleConfigurator;

if (ordinalScale != null)
{
axis.UpdateScale();

int categoryCount = ordinalScale.Labels.Count;

double[] tickValues = new double[categoryCount];

for (int i = 0; i < categoryCount; i++)
{
tickValues[i] = i + 0.5;
}

NCustomRangeSampler rangeSampler = new NCustomRangeSampler(tickValues);

NScaleTickFactory tickFactory = new NScaleTickFactory(ScaleTickShape.Line,
new NLength(0),
new NSizeL(new NLength(1), new NLength(5, NGraphicsUnit.Point)),
new NConstValueProvider(new NColorFillStyle(Color.Black)),
new NConstValueProvider(new NStrokeStyle(1, Color.Black)),
HorzAlign.Left);

NScaleLevel scaleLevel = new NScaleLevel();
scaleLevel.Decorators.Add(new NSampledScaleDecorator(rangeSampler, tickFactory));

axis.Scale.Levels.Insert(0, scaleLevel);
axis.Scale.OriginLevel = axis.Scale.OriginLevel + 1;
}
}
}
}

This is working great :-)

Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Andre,

Can you send the attachment to support@nevron.com for further investigation.



Best Regards,
Nevron Support Team


Andre Van Wyk
Andre Van Wyk
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)
Group: Forum Members
Posts: 4, Visits: 1
Hi

A tick is visible where the x-axis touches the y-axis and I want it removed or hidden.
Please see the attached screenshot.

Thanks,
Andre

Edited: Looks like the attachment didn't make it. I am using the category grouping labels on the axis to create the ticks on the x-axis on both sides of the bars. Where this overlaps the y-axis, it is visible. I cannot determine where to set it's color and thickness; if I can do that it may be indistinguishable from the y-axis.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search