Profile Picture

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

Posted By Andre Van Wyk 12 Years Ago

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

Author
Message
Andre Van Wyk
Posted 12 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 12 Years Ago
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.

Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746

Hi Andre,

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



Best Regards,
Nevron Support Team



Andre Van Wyk
Posted 12 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 12 Years Ago
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 :-)




Similar Topics


Reading This Topic