Nevron Forum
Back
Login
Register
Login
Register
Home
»
Nevron Vision for SSRS
»
Nevron Chart for Reporting Services
»
X-axis dates with inconsistent time-intervals
X-axis dates with inconsistent time-intervals
Post Reply
X-axis
date
s with inconsistent time-intervals
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
Goto Topics Forum
Author
Message
Vahid Mesri
Vahid Mesri
posted 8 Years Ago
ANSWER
Topic Details
Group: Forum Members
Posts: 11,
Visits: 67
Hi,
In my smooth-line plot, the x-values are
date
s and the y-values are percentages.
The issue is that I have monthly values at the beginning section of my plot, however, after two years, the
date
s are up
date
d on yearly basis, therefore the
date
s do not have consistent intervals.
Please find attached the plot I've created using the Microsoft chart control. I would like to use Nevron to reproduce this plot but unfortunately it treats the
date
s as categories and not
date
time variables.
Thanks a lot for your help
Tags
date
inconsistentcy
scale
x-axis
Reply
Like
0
Nevron Support
Nevron Support
posted 8 Years Ago
ANSWER
Post Details
Group: Administrators
Posts: 3.1K,
Visits: 4.2K
Hello Vahid,
What is the data type for the X axis - are you using
Date
Time or String values?
You should be able to switch the Smooth Line - Sub Type to: XY Scatter. Then in the Values Grouping Editor, you need to pass the X value (for example: =Fields!
Date
.Value).
From the Chart Areas -> Axes -> Primary X -> Scale tab, from Numeric tab, you can choose
Date
Time sub type and you can configure the formatting. You can check some of the report examples shipped with the installation (for example: CalculatedSeries_PolynomialRegression.rdl).
Hopefully this helps. Let us know if you have any questions or if you need assistance.
Best Regards,
Nevron Support Team
Reply
Like
0
Vahid Mesri
Vahid Mesri
posted 8 Years Ago
ANSWER
Post Details
Group: Forum Members
Posts: 11,
Visits: 67
Thanks a lot for your reply. Indeed, changing the plot sub type to XY scatter did solve my problem, however, no I'm experiencing a new issue with x-axis labels.
I would like to reproduce the plot on the left-side using Nevron
The issue is that the x-axis in my data (testData.csv) consists of
date
s commencing from March 2015 but Nevron selects Jan 2015 when generating the labels automatically. Please note that the time-differences between the
date
s are not equal.
Even when I set the x-axis scale to have custom steps and set the start range of my plot to March 2015, the generated lables in Nevron begin from January 2015 (and not March).
Thanks alot
p.s. I've attached the csv and rdl. to replicate, please remove the ".txt" extension and copy the csv file to "c:\rep"
Attachments
testData.csv.txt
(
738 views,
899 bytes
)
testNevron.rdl.txt
(
709 views,
16.00 KB
)
Tags
inconsistency
label
scale
x-axis
Reply
Like
0
Nevron Support
Nevron Support
posted 8 Years Ago
ANSWER
Post Details
Group: Administrators
Posts: 3.1K,
Visits: 4.2K
Hello Vahid,
This is caused by the default axis scaling. You can use the following custom C# code:
using System;
using System.Drawing;
using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.ReportingServices;
namespace MyNamespace
{
/// <summary>
/// Sample class
/// </summary>
public class MyClass
{
/// <summary>
/// Main entry point
/// </summary>
/// <param name="context"></param>
public static void RSMain(NRSChartCodeContext context)
{
NChart chart = context.document.Charts[0];
N
Date
TimeScaleConfigurator
date
TimeScale = chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as N
Date
TimeScaleConfigurator;
if (
date
TimeScale != null)
{
bool hasMin = false;
Date
Time minValue = new
Date
Time();
foreach (NSeriesBase series in chart.Series)
{
NXYScatterSeries xyScatter = series as NXYScatterSeries;
if (xyScatter != null && xyScatter.XValues.Count > 0)
{
Date
Time curXValue =
Date
Time.FromOA
Date
((double)xyScatter.XValues[0]);
if (hasMin)
{
minValue = minValue < curXValue ? minValue : curXValue;
}
else
{
hasMin = true;
minValue = curXValue;
}
}
}
if (hasMin)
{
date
TimeScale.UseOrigin = true;
date
TimeScale.Origin = new
Date
Time(minValue.Year, minValue.Month, 1, 0, 0, 0);
}
}
}
}
}
Best Regards,
Nevron Support Team
Reply
Like
1
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search