Ssrs line charts
Hi,
I have a report,in this report having some line charts but these are not effective look for clients.I need to be create effective line charts for clients.Please help me guys
Hi MS SQLSERVER,
Per my understanding that you want to create an line chart more effective and dynamic, right?
I would like you to provide more details information about your requirements about the effective you mentioned and also provide us sample data of table.
Please reference to some good sample of chart below:
http://www.bigator.com/2012/03/12/line-chart-bar-chart-in-ssrs-report/
https://www.simple-talk.com/sql/reporting-services/sql-server-reporting-services-advanced-charting/
If you still have any problem, please feel free to ask.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support
Similar Messages
-
Show Timestamp on Y axis in a SSRS line chart.
I have a column with datatype as timestamp. And i want to show that column on Y axis in a line chart. two sample values from that column are 03/01/2014 11:30 PM and 03/02/2014 12:10 AM. In this case the data point for first value should be less compare
to the second one, i.e. the series should consider the complete timestamp. Is there a way in SSRS to achieve it.
If I only take the time value from timestamp on Y axis and plot the chart then the data point for 12:10 AM is less than the 11:30 PM, which is not true in this case.
ApoorvaWHi ApoorvaW,
In Reporting Services, if we directly add the Timestamp field to Y Axis, it displays the count values in the line chart. When we modify the expression of the value to [Timestamp], it displays the date value in the Y Axis. Though it displays date type as
the axis label, it represent the complete timestamp.
So in my environment, the timestamp display very well in the line chart. If there are any misunderstanding, please elaborate the issue for further investigation.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
SSRS line chart showing premium change pct over time
Hi,
I have an SSRS report sitting over a cube. I'm building a Line chart to show premium change over time by producer (there are currently 6 producers). I have the Producer Name, Quarter/Year, and Premium amt.
I want to have the premium line trend based on the percentage of change from Quarter to Quarter. Quarter will be the X-Axis and percentage will be the Y axis. The premium for the first quarter should start at 100%. Each premium line for
the producer should then change up or down based on the change in premium per quarter. The end result should look something like this: Can this be done using SSRS?Hi,
I have an SSRS report sitting over a cube. I'm building a Line chart to show premium change over time by producer (there are currently 6 producers). I have the Producer Name, Quarter/Year, and Premium amt.
I want to have the premium line trend based on the percentage of change from Quarter to Quarter. Quarter will be the X-Axis and percentage will be the Y axis. The premium for the first quarter should start at 100%. Each premium line for
the producer should then change up or down based on the change in premium per quarter. The end result should look something like this: Can this be done using SSRS? -
Diagonal line on SSRS line chart
Hi all,
I'm struggling with a charting issue that I was hoping someone here might be able to help with - I've looked through various blogs without success. I need to insert a diagonal line running the full width of a line chart, representing the linearly increasing
target value over a month. The actual data will then be a secondary series on the same vertical axis, showing progress against the target based on today's data.
This report has several limitations that I should emphasise before someone says "Well, why can't you just generate the target data in the SQL query?". It's for Dynamics CRM Online, so the only type of data source and query allowed is FetchXML.
I can't even use a simple SQL query that returns constant values, let alone an actual SQL DB query. It also doesn't seem to be possible to have any custom code in the report, which makes it even more frustrating. FetchXML is just not set up to do things like
return constant values in a query, or return a dataset which is the set of days in the current month.
What I do have is two datasets, one of which returns the actual data, which I've used as the first series in the table, and a second dataset that returns a single value that represents the target for the month. There's no way, as far as I'm aware, to cross-join
that with a set of dates and then use a calculated field in the dataset to turn it into a linear series.
I've set the min and max values of the X-axis to show me all dates, and my initial solution to the problem was to have a horizontal line at the target value, as shown below (red dotted line). However, I've been asked to change that to the solid red diagonal
line as shown:
Series 1 (Total order value) is the RunningValue of the daily order values, summed across the dates.
Series 1 data looks something like this:
[Date] [Order Value]
1 Mar 100
3 Mar 20
3 Mar 35
24 Mar 400
Series 2 data just has
[Target Name] [Target Value]
Sales Target 25000
Does anyone have ideas on how I can do this? I'm happy to take any suggestions; the line doesn't have to be interactive or be an action, so it could even be rendered directly onto the chart, if that's possible. The only limitation is that it needs to be
viewed on screen, and be printable. I'd prefer some sort of elegant approach that allows me to do it as two series on the same chart, but frankly at this point I'm beyond caring how it's done - so long as it works, it can be held together with chewing gum
and string.Hi Anuruddha,
When you want to see the diagonal line, you should divide the target value with number of values in x-axis,
let say Month March has 31 days, your target is 25000
then 25000/31=806.4516129032258
But to do dynamic you need to get the number of days in month
=day(DateAdd("d",-1,DateAdd("M",1,cdate(cstr(Month(First(Fields!workday.Value, "DataSet3")) )+"/01/" + cstr(Year(First(Fields!workday.Value, "DataSet3")))))))
Create another series like below shown:-
a Above expression :-
= (Sum(Fields!target.Value, "DataSet2")/ (day(DateAdd("d",-1,DateAdd("M",1,cdate(cstr(Month(First(Fields!workday.Value, "DataSet3")) )+"/01/" + cstr(Year(First(Fields!workday.Value, "DataSet3")))))))))*Fields!id.Value
Run the report:-
Orange Line is yours previously, Red Line is what you want.
I am doing calculation in series, so there is no problem for you as you can't write SQL query.
Below is the RDL code , which will help you to check the expressions.
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<Body>
<ReportItems>
<Textbox Name="textbox1">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Sparkline</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>12pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>SteelBlue</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>textbox1</rd:DefaultName>
<Height>0.37in</Height>
<Width>5in</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Chart Name="Chart1">
<ChartCategoryHierarchy>
<ChartMembers>
<ChartMember>
<Group Name="Chart1_CategoryGroup">
<GroupExpressions>
<GroupExpression>=Fields!workday.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!workday.Value</Value>
</SortExpression>
</SortExpressions>
<Label>=Fields!workday.Value</Label>
</ChartMember>
</ChartMembers>
</ChartCategoryHierarchy>
<ChartSeriesHierarchy>
<ChartMembers>
<ChartMember>
<Label>value</Label>
</ChartMember>
<ChartMember>
<Label>target</Label>
</ChartMember>
<ChartMember>
<Label>id</Label>
</ChartMember>
</ChartMembers>
</ChartSeriesHierarchy>
<ChartData>
<ChartSeriesCollection>
<ChartSeries Name="value">
<ChartDataPoints>
<ChartDataPoint>
<ChartDataPointValues>
<Y>=RunningValue(Fields!value.Value,Sum,"DataSet3")</Y>
</ChartDataPointValues>
<ChartDataLabel>
<Style />
</ChartDataLabel>
<Style />
<ChartMarker>
<Style />
</ChartMarker>
<DataElementOutput>Output</DataElementOutput>
</ChartDataPoint>
</ChartDataPoints>
<Type>Line</Type>
<Style />
<ChartEmptyPoints>
<Style />
<ChartMarker>
<Style />
</ChartMarker>
<ChartDataLabel>
<Style />
</ChartDataLabel>
</ChartEmptyPoints>
<ValueAxisName>Primary</ValueAxisName>
<CategoryAxisName>Primary</CategoryAxisName>
<ChartSmartLabel>
<CalloutLineColor>Black</CalloutLineColor>
<MinMovingDistance>0pt</MinMovingDistance>
</ChartSmartLabel>
</ChartSeries>
<ChartSeries Name="IDDetails">
<ChartDataPoints>
<ChartDataPoint>
<ChartDataPointValues>
<Y>=Sum(Fields!target.Value, "DataSet2")</Y>
</ChartDataPointValues>
<ChartDataLabel>
<Style />
</ChartDataLabel>
<Style />
<ChartMarker>
<Style />
</ChartMarker>
<DataElementOutput>Output</DataElementOutput>
</ChartDataPoint>
</ChartDataPoints>
<Type>Line</Type>
<Style />
<ChartEmptyPoints>
<Style />
<ChartMarker>
<Style />
</ChartMarker>
<ChartDataLabel>
<Style />
</ChartDataLabel>
</ChartEmptyPoints>
<ValueAxisName>Primary</ValueAxisName>
<CategoryAxisName>Primary</CategoryAxisName>
<ChartSmartLabel>
<CalloutLineColor>Black</CalloutLineColor>
<MinMovingDistance>0pt</MinMovingDistance>
</ChartSmartLabel>
</ChartSeries>
<ChartSeries Name="Series">
<ChartDataPoints>
<ChartDataPoint>
<ChartDataPointValues>
<Y>= (Sum(Fields!target.Value, "DataSet2")/ (day(DateAdd("d",-1,DateAdd("M",1,cdate(cstr(Month(First(Fields!workday.Value, "DataSet3")) )+"/01/" + cstr(Year(First(Fields!workday.Value, "DataSet3")))))))))*Fields!id.Value</Y>
</ChartDataPointValues>
<ChartDataLabel>
<Style />
</ChartDataLabel>
<Style />
<ChartMarker>
<Style />
</ChartMarker>
<DataElementOutput>Output</DataElementOutput>
</ChartDataPoint>
</ChartDataPoints>
<Type>Line</Type>
<Style />
<ChartEmptyPoints>
<Style />
<ChartMarker>
<Style />
</ChartMarker>
<ChartDataLabel>
<Style />
</ChartDataLabel>
</ChartEmptyPoints>
<ValueAxisName>Primary</ValueAxisName>
<CategoryAxisName>Primary</CategoryAxisName>
<ChartSmartLabel>
<CalloutLineColor>Black</CalloutLineColor>
<MinMovingDistance>0pt</MinMovingDistance>
</ChartSmartLabel>
</ChartSeries>
</ChartSeriesCollection>
</ChartData>
<ChartAreas>
<ChartArea Name="Default">
<ChartCategoryAxes>
<ChartAxis Name="Primary">
<Style>
<FontSize>8pt</FontSize>
</Style>
<ChartAxisTitle>
<Caption>Axis Title</Caption>
<Style>
<FontSize>8pt</FontSize>
</Style>
</ChartAxisTitle>
<ChartMajorGridLines>
<Enabled>False</Enabled>
<Style>
<Border>
<Color>Gainsboro</Color>
</Border>
</Style>
</ChartMajorGridLines>
<ChartMinorGridLines>
<Style>
<Border>
<Color>Gainsboro</Color>
<Style>Dotted</Style>
</Border>
</Style>
</ChartMinorGridLines>
<ChartMinorTickMarks>
<Length>0.5</Length>
</ChartMinorTickMarks>
<CrossAt>NaN</CrossAt>
<Minimum>NaN</Minimum>
<Maximum>NaN</Maximum>
<ChartAxisScaleBreak>
<Style />
</ChartAxisScaleBreak>
</ChartAxis>
<ChartAxis Name="Secondary">
<Style>
<FontSize>8pt</FontSize>
</Style>
<ChartAxisTitle>
<Caption>Axis Title</Caption>
<Style>
<FontSize>8pt</FontSize>
</Style>
</ChartAxisTitle>
<ChartMajorGridLines>
<Enabled>False</Enabled>
<Style>
<Border>
<Color>Gainsboro</Color>
</Border>
</Style>
</ChartMajorGridLines>
<ChartMinorGridLines>
<Style>
<Border>
<Color>Gainsboro</Color>
<Style>Dotted</Style>
</Border>
</Style>
</ChartMinorGridLines>
<ChartMinorTickMarks>
<Length>0.5</Length>
</ChartMinorTickMarks>
<CrossAt>NaN</CrossAt>
<Location>Opposite</Location>
<Minimum>NaN</Minimum>
<Maximum>NaN</Maximum>
<ChartAxisScaleBreak>
<Style />
</ChartAxisScaleBreak>
</ChartAxis>
</ChartCategoryAxes>
<ChartValueAxes>
<ChartAxis Name="Primary">
<Style>
<FontSize>8pt</FontSize>
</Style>
<ChartAxisTitle>
<Caption>Axis Title</Caption>
<Style>
<FontSize>8pt</FontSize>
</Style>
</ChartAxisTitle>
<ChartMajorGridLines>
<Style>
<Border>
<Color>Gainsboro</Color>
</Border>
</Style>
</ChartMajorGridLines>
<ChartMinorGridLines>
<Style>
<Border>
<Color>Gainsboro</Color>
<Style>Dotted</Style>
</Border>
</Style>
</ChartMinorGridLines>
<ChartMinorTickMarks>
<Length>0.5</Length>
</ChartMinorTickMarks>
<CrossAt>NaN</CrossAt>
<Minimum>NaN</Minimum>
<Maximum>NaN</Maximum>
<ChartAxisScaleBreak>
<Style />
</ChartAxisScaleBreak>
</ChartAxis>
<ChartAxis Name="Secondary">
<Style>
<FontSize>8pt</FontSize>
</Style>
<ChartAxisTitle>
<Caption>Axis Title</Caption>
<Style>
<FontSize>8pt</FontSize>
</Style>
</ChartAxisTitle>
<ChartMajorGridLines>
<Style>
<Border>
<Color>Gainsboro</Color>
</Border>
</Style>
</ChartMajorGridLines>
<ChartMinorGridLines>
<Style>
<Border>
<Color>Gainsboro</Color>
<Style>Dotted</Style>
</Border>
</Style>
</ChartMinorGridLines>
<ChartMinorTickMarks>
<Length>0.5</Length>
</ChartMinorTickMarks>
<CrossAt>NaN</CrossAt>
<Location>Opposite</Location>
<Minimum>NaN</Minimum>
<Maximum>NaN</Maximum>
<ChartAxisScaleBreak>
<Style />
</ChartAxisScaleBreak>
</ChartAxis>
</ChartValueAxes>
<Style>
<BackgroundGradientType>None</BackgroundGradientType>
</Style>
</ChartArea>
</ChartAreas>
<ChartLegends>
<ChartLegend Name="Default">
<Style>
<BackgroundGradientType>None</BackgroundGradientType>
<FontSize>8pt</FontSize>
</Style>
<ChartLegendTitle>
<Caption />
<Style>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
<TextAlign>Center</TextAlign>
</Style>
</ChartLegendTitle>
<HeaderSeparatorColor>Black</HeaderSeparatorColor>
<ColumnSeparatorColor>Black</ColumnSeparatorColor>
</ChartLegend>
</ChartLegends>
<ChartTitles>
<ChartTitle Name="Default">
<Caption>Chart Title</Caption>
<Style>
<BackgroundGradientType>None</BackgroundGradientType>
<FontWeight>Bold</FontWeight>
<TextAlign>General</TextAlign>
<VerticalAlign>Top</VerticalAlign>
</Style>
</ChartTitle>
</ChartTitles>
<Palette>BrightPastel</Palette>
<ChartBorderSkin>
<Style>
<BackgroundColor>Gray</BackgroundColor>
<BackgroundGradientType>None</BackgroundGradientType>
<Color>White</Color>
</Style>
</ChartBorderSkin>
<ChartNoDataMessage Name="NoDataMessage">
<Caption>No Data Available</Caption>
<Style>
<BackgroundGradientType>None</BackgroundGradientType>
<TextAlign>General</TextAlign>
<VerticalAlign>Top</VerticalAlign>
</Style>
</ChartNoDataMessage>
<DataSetName>DataSet3</DataSetName>
<Top>0.59667in</Top>
<Left>0.24667in</Left>
<Height>3.55in</Height>
<Width>4.53667in</Width>
<ZIndex>1</ZIndex>
<Style>
<Border>
<Color>LightGrey</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>White</BackgroundColor>
<BackgroundGradientType>None</BackgroundGradientType>
</Style>
</Chart>
<Textbox Name="Textbox2">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=day(DateAdd("d",-1,DateAdd("M",1,cdate(cstr(Month(First(Fields!workday.Value, "DataSet3")) )+"/01/" + cstr(Year(First(Fields!workday.Value, "DataSet3")))))))</Value>
<Style />
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName>
<Top>4.33833in</Top>
<Left>2.21333in</Left>
<Height>0.25in</Height>
<Width>1in</Width>
<ZIndex>2</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Height>4.71333in</Height>
<Style />
</Body>
<Width>5in</Width>
<Page>
<LeftMargin>1in</LeftMargin>
<RightMargin>1in</RightMargin>
<TopMargin>1in</TopMargin>
<BottomMargin>1in</BottomMargin>
<Style />
</Page>
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="DataSource1">
<DataSourceReference>DataSource1</DataSourceReference>
<rd:SecurityType>None</rd:SecurityType>
<rd:DataSourceID>6abd5341-c043-4ab1-b449-c32e00efc4ac</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="DataSet1">
<Query>
<DataSourceName>DataSource1</DataSourceName>
<CommandText>SELECT 1 ID, 1 MONTH, 50 VALUE
UNION
SELECT 1 ID, 2 MONTH, 30 VALUE
UNION
SELECT 1 ID, 3 MONTH, 20 VALUE
UNION
SELECT 1 ID, 4 MONTH, 10 VALUE
UNION
SELECT 1 ID, 5 MONTH, 25 VALUE
UNION
SELECT 1 ID, 6 MONTH, 50 VALUE
UNION
SELECT 1 ID, 7 MONTH, 10 VALUE
UNION
SELECT 1 ID, 8 MONTH, 20 VALUE
UNION
SELECT 1 ID, 9 MONTH, 30 VALUE
UNION
SELECT 1 ID, 10 MONTH, 40 VALUE
UNION
SELECT 1 ID, 11 MONTH, 45 VALUE
UNION
SELECT 1 ID, 12 MONTH, 50 VALUE
UNION
SELECT 2 ID, 1 MONTH, 25 VALUE
UNION
SELECT 2 ID, 2 MONTH, 30 VALUE
UNION
SELECT 2 ID, 3 MONTH, 10 VALUE
UNION
SELECT 2 ID, 4 MONTH, 30 VALUE
UNION
SELECT 2 ID, 5 MONTH, 45 VALUE
UNION
SELECT 2 ID, 6 MONTH, 35 VALUE
UNION
SELECT 2 ID, 7 MONTH, 10 VALUE
UNION
SELECT 2 ID, 8 MONTH, 50 VALUE
UNION
SELECT 2 ID, 9 MONTH, 20 VALUE
UNION
SELECT 2 ID, 10 MONTH, 14 VALUE
UNION
SELECT 2 ID, 11 MONTH, 40 VALUE
UNION
SELECT 2 ID, 12 MONTH, 45 VALUE</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
<Fields>
<Field Name="ID">
<DataField>ID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="MONTH">
<DataField>MONTH</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="VALUE">
<DataField>VALUE</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
</Fields>
</DataSet>
<DataSet Name="DataSet2">
<Query>
<DataSourceName>DataSource1</DataSourceName>
<CommandText>Select 25000 target</CommandText>
</Query>
<Fields>
<Field Name="target">
<DataField>target</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
</Fields>
</DataSet>
<DataSet Name="DataSet3">
<Query>
<DataSourceName>DataSource1</DataSourceName>
<CommandText>
select 1 id, '03/01/2015' workday , 100 value
union
select 2 id, '03/02/2015' workday , 50 value
union
select 3 id, '03/03/2015' workday , 400 value
union
select 4 id, '03/04/2015' workday , 300 value
union
select 5 id, '03/05/2015' workday , 250 value
union
select 6 id, '03/06/2015' workday , 200 value
union
select 7 id, '03/07/2015' workday , 500 value
union
select 8 id, '03/08/2015' workday , 700 value
union
select 9 id, '03/09/2015' workday , 50 value
union
select 10 id, '03/10/2015' workday , 450 value
union
select 11 id, '03/11/2015' workday , 350 value
union
select 12 id, '03/12/2015' workday , 100 value
union
select 13 id, '03/13/2015' workday , 100 value
union
select 14 id, '03/14/2015' workday , 100 value
union
select 15 id, '03/15/2015' workday , 200 value
union
select 16 id, '03/16/2015' workday , 700 value
union
select 17 id, '03/17/2015' workday , 450 value
union
select 18 id, '03/18/2015' workday , 100 value
union
select 19 id, '03/19/2015' workday , 700 value
union
select 20 id, '03/20/2015' workday , 300 value
union
select 21 id, '03/21/2015' workday , 100 value
union
select 22 id, '03/22/2015' workday , 200 value
union
select 23 id, '03/23/2015' workday , 700 value
union
select 24 id, '03/24/2015' workday , 100 value
union
select 25 id, '03/25/2015' workday , 100 value
union
select 26 id, '03/26/2015' workday , 450 value
union
select 27 id, '03/27/2015' workday , 200 value
union
select 28 id, '03/28/2015' workday , 100 value
union
select 29 id, '03/29/2015' workday , 450 value
union
select 30 id, '03/30/2015' workday , 300 value
union
select 31 id, '03/31/2015' workday , 700 value</CommandText>
</Query>
<Fields>
<Field Name="id">
<DataField>id</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="workday">
<DataField>workday</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="value">
<DataField>value</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
</Fields>
</DataSet>
</DataSets>
<Language>en-US</Language>
<ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
<rd:ReportUnitType>Inch</rd:ReportUnitType>
<rd:ReportID>59e8101c-8585-409d-82e7-c6719e928567</rd:ReportID>
</Report>
Thanks
Prasad
Mark this as Answer if it helps you to proceed on further. -
Hi,
Problem:
I have an issue of SSRS Line Chart extending backward and forward (same issue discussed in post - http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/3cebd5b2-bb15-4bd1-be16-0daadc613082/)
when Empty point option Value is set Average
I tried sorting on Category Group as suggested by Sean Boon in the URL mentioned above. But, still the issue is not fixed.
I am using SSRS R2.
Thoughts ?Hi,
Problem:
I have an issue of SSRS Line Chart extending backward and forward (same issue discussed in post - http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/3cebd5b2-bb15-4bd1-be16-0daadc613082/)
when Empty point option Value is set Average
I tried sorting on Category Group as suggested by Sean Boon in the URL mentioned above. But, still the issue is not fixed.
I am using SSRS R2.
Thoughts ?
I am running into the same issue again :( -
How to use stripline in ssrs line chatrs
Hi,
I want to know how to use striplines in ssrs line charts?Hi ,
You can use below link;
https://msdn.microsoft.com/en-us/library/dd239316.aspx?f=255&MSPPError=-2147217396
https://sqlserverbiblog.wordpress.com/tag/strip-line/
http://blogs.adatis.co.uk/blogs/jeoc/archive/2013/07/23/adding-strip-lines-to-reports.aspx
Thanks
Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com -
Plot empty point in line chart with previous non empty value
Hello,
I have a problem to plot series data in SSRS line chart, with the empty point, I don't want use average and zero provided by the report builder, I want use the last non empty data to fill the empty point, tried to use expression =Previous(Field!Value), no
luck, any one have some good idea?
P.S. do not want to use query to fill the null with previous non null value, just from the performance point view. at last , the chart should have some line as square wave with different height, if I use average for empty point, it shows slop wave line which
is not reflect the real production.
Thanks
RichardHi Richard,
In Reporting Services, if the chart type is a linear chart type (bar, column, scatter, line, area, range), null values are shown on the chart as empty spaces or gaps between data points in a series. By default, empty points are calculated by taking the average
of the previous and next data points that are not null.
If we want to use previous value to replace the empty value, please refer to the following steps:
Right-click the field which displayed in Y axis (Height) to open the Series Properties.
In the Value field to modify the expression to look like this:
=iif(isnothing(Sum(Fields!Height.Value)),previous(sum(Fields!Height.Value)),sum(Fields!Height.Value))
The following screenshot is for your reference:
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
What is the best way to create a SSRS 2005 Line Chart Report for a 12 month period?
I'm looking for advice on how to create a SQL Server 2005 query and line chart report for SSRS 2005.
I need to display the peak number of patients assigned to a medical practice each month for a 12 month period based on the end-user selecting a
single month and year.
I've previously created a report that displays all patients assigned to the practice for any single month but I’m looking for advice on how to
how to produce a resultset that shows the peak number of patients each month for a 12 month period. I thought about creating a query that returns the peak count for each month (based on my previously created report which displays all patients assigned to the
practice for any single month) and then use a UNION statement to join all 12 months but I'm sure that isn't the most efficient way to do this. The other challenge with this approach (twelve resultsets combined via a UNION) is that the end-user needs to be
able to select any month and year for the parameter and the report needs to display the 12 month period based on the month selected (the month selected would be the last month of the 12 month period).
For the report I’ve previously created that displays all patients assigned to the practice for any single month, the WHERE statement filters the
resultset on two fields:
Start Date - The date the patient was assigned to the practice. This field is never null or blank.
End Date - The date the patient left the practice. This field can be null or blank as active patients assigned to the practice do not have an End Date. When the patient
leaves the practice, the date the patient left is populated in this field.
Using these two fields I can return all patients assigned to the practice during Nov 2012 by looking for patients that meet the following criteria:
start date prior to 11/30/2012 (using the last day of the month selected ensures patients added mid-month would be included)
AND
end date is null or blank (indicates the patient is active) OR the end date is between 11/1/2012 -11/30/2012 (returns patients that leave during the month
selected)
Regarding the query I need to create for the report that displays the peak count each month for 12 months, I'm looking for advice on
how to count patients for each month the patient is assigned to the practice if the patient has been assigned for several months (which applies to most patients). Examples are:
John Doe has a start date of 6/01/2012 and an End Date of 10/07/2012
Sally Doe has a start date of 8/4/2012 and no End Date (the patient is still active)
Jimmy Doe has a start of 7/3/2012 and an End Date of 9/2/2012
Given these examples how would I include John Doe in the peak monthly count each month for May - October, Sally Doe in the peak monthly count for
August - December and Jimmy Doe in the peak monthly count for July – Sept if the end-user running the report selected December 2012 as the parameter?
Given the example above and the fact I'm creating a line chart I think the best way to create this report would be a resultset that looks like
this:
Patient Name
Months Assigned
John Doe
June 2012
John Doe
July012
John Doe
Aug 2012
John Doe
Sept 2012
John Doe
Oct 2012
Sally Doe
Aug 2012
Sally Doe
Sept 2012
Sally Doe
Oct 2012
Sally Doe
Nov 2012
Sally Doe
Dec 2012
Jimmy Doe
July 2012
Jimmy Doe
Aug 2012
Jimmy Doe
Sept 2012
From the resultset above I could create another resultset that would count\group on month and year to return the peak count for each month:
June 2012 - 1
July 2012 – 2
Aug 2012 - 3
Sept 2012 - 3
Oct 2012 - 2
Nov 2012 - 1
Dec 2012 - 1
The resultset that displays the peak count for each month would be used to create the line chart (month would be the X axis and the count would
be the y axis).
Does this sound like the best approach?
If so, any advice on how to create the resultset that lists each patient and each month they were assigned to the practice would be greatly appreciated.
I do not have permissions to create SPs or Functions within the database but I can create temp tables.
I know how to create the peak monthly count query (derived from the query that lists each patient and month assigned) as well as the line chart.
Any advice or help is greatly appreciated.Thanks for the replies. I reviewed them shortly after they were submitted but I'm also working on other projects at the same time (hence the delayed reply).
Building a time table and doing a cross join to my original resultset gave me the desired resultset of the months assigned between dates. What I can't figure out now is how to filter months I don't want.
Doing a cross join between my original resultset that had two dates:
08/27/2010
10/24/2011
and a calendar table that has 24 rows (each month for a two year period)
my new resultset looks like this:
I need to filter the rows in yellow as the months assigned for stage 3 that started on 8/27/2010 should stop when the patient was assigned to stage 4 on 10/24/2011.
You'll notice that Jan - Sept 2011 isn't listed for Stage 4 assigned on 10/24/2011 as I included a filter in the WHERE clause that states
the Months Assigned value must be greater than or equal to the date assigned value.
Any advice would be appreciated. -
SSRS 2008 Line Chart Issue.
We are facing an issue with SSRS 2008 charts. We have a report which shows dynamic number of series on a line chart. The data values may not exist for all series for
the same x axis points. We expected SSRS to connect the missing points as average and have set the empty point option to average.
The issue is that the
1)
lines for interpolated points only appear when we set the color of empty point to say red and not when it is set to automatic. We need the interpolated line in the same auto
colour as the original line as we will have markers for the data points from the DB and no markers for empty points.
2)
The interpolated lines extend backwards in the series also – we expect it to only fill the gaps and not extend backward or forward.
Are these issues known and is there a work around for these issues ? We got your name from one of the SSRS community discussions. Could you please connect us with
the right person if you are not the right contact for this issue ?
I also got following reply from one of the MS guy, it says
Hi Akshay,
The lines should not go backward. I have seen this happen before and I’ll have to double-check on what that occurs. If you
are using a Category Axis, make sure you set the sorting to use a Cdate() expression. I think that might be it ,but I’ll have to double check.
As far as using the auto-coloring on the series when you have empty points like this, I don’t think that’s possible. It would require
a DCR. You may need to implement something along the lines described in this article http://msdn.microsoft.com/en-us/library/aa964128(SQL.90).aspx.
When I tried the suggestions I over come the auto colouring issue and also used CDATE () but lines still extend bacawords. Can anyone suggest what to do it this situationHi AKshay_Jadhav,
Firstly, I am not sure who is that MS guy you mentioned without the detail name. Based on my understanding to your issue, I think you could utilize the function
IsNothing in reoprting services to have a check whether the value is null, if it is Null, you should give a average value to this point, if not leave it to be the original value. Of course, you could achieve this in T-SQL. To
the color and marker, we could type in the expression in both feature to control their display effort.
Hope this helps.
Thanks,
Challen Fu
Challen Fu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
SSRS 2008: Line chart Y-Axis scale issue
Hi All,
After search of one week, finally decided to put my question in front of you all. Hope I will get some outcome from it.
Currently I am working on Line Chart. Following is the data which I need to bind to line chart.
JobStartDate JobStartTime JobEndTime
1/1/2015 01.00 02.30
1/2/2015 01.02 03.20
1/3/2015 01.01 03.40
1/4/2015 01.05 02.00
1/5/2015 22.03 23.30
1/6/2015 22.05 23.40
So, In above scenario Line chart looks like:
11.00 PM | /////////
10.00 PM | ..........
........ |
04.00 AM | /
03.00 AM | / /
02.00 AM | / /
01.00 AM | .....................
12.00 AM |______________________________________________
1/1/15 1/2/15 1/3/15 1/4/15 1/5/15 1/6/15
But it should be like :
04.00 AM | /
03.00 AM | / /
02.00 AM | / /
01.00 AM | .....................
12.00 AM |
11.00 PM |
10.00 PM |
09.00 PM |______________________________________________
1/1/15 1/2/15 1/3/15 1/4/15 1/5/15 1/6/15
(Sorry As cant upload the image. So, Tried to show as above.)
In above figure (.) is StartTime and (/) is EndTime.
You can see that I am facing the problem of Y-Axis scaling.
Hope everyone understand my problem. Please let me know more explanation.Hi Prashant Khadatkar,
As per my understanding, you created a line chart, you added JobStartTime and JobEndTime to values area, and added JobStartDate to category groups. You want to display data of y axis from PM to AM. In order to improve the efficiency of troubleshooting, I
need to ask several questions:
What’s the data type of JobStartTime and JobEndTime?
Is the data stored in database the same as you provided?
What’s the state of report now? Please provide some more detailed information of the report. I would be appreciated it if you could provide sample data and screenshot of the report.
This may be a lot of information to ask for at one time. However, by collecting this information now, it will help us move more quickly toward a solution.
Thanks,
Wendy Fu
Wendy Fu
TechNet Community Support -
Horizontal Bar Chart and Overlaying Line Chart
I am using SSRS 2008 and developing my reports in BIDS.
I have a report with two data points. I want to chart the first as a bar (horizontal) chart and then the second as an overlaying line chart.
I created both data series, originally, as a bar chart. I have clicked on the second series in the "Drop Data Fields Here" area and changed the chart to a line chart. When I do that, it changes both series to a line chart.
However, if I use the column (vertical) chart for the first series, it will let me make the second one a line chart.
Is this a limitation of SSRS 2008? Can I not have one data point be the horizontal bar chart and the second one a line chart?
If so, are there any suggestions how to get around this?
Thanks.Both charts for SSRS 2005/2008 are very limited when it comes to horizontal charts and are infact supporting only left-to-right bar charts, with no ability to combine them with other charting types (lines, areas, points etc.). For a SSRS charting solution that supports all types of charting type combinations in left-to-right and right-to-left horizontal fashion you can use Nevron Chart for SSRS - www.nevron.com. Besides a huge number of charting types and subtypes (most of which are not available in the MS Chart for SSRS 2008) it also provides better image quality in 2D and 3D modes, more settings, has support for rich text formatting in texts, has image filters, ability to customize via C# code and implements many more large and small charting related details.
Best regards,
Crank -
Combining a Line Chart with a Bar Chart
I'm required to render a chart that has a line chart in the background with a bar chart in the foreground. BarChart requires with one of the axes be Category while the LineChart needs to have both axes be Numeric.
I had seen another post suggesting using a StackPane to put 2 distinct charts on top of each other. I don't think this will be suitable for this due to how different the one axis needs to be.
My hunch is to simply write a new XYChart that renders bars instead of lines. Any other ideas?
Thanks,Hi Chirs,
In SSRS, the chart type is by design. It is not support vertical line chart.
Reference: http://technet.microsoft.com/en-us/library/dd220461.aspx
Since the issue is by default, I recommend you that submit this suggestion at
https://connect.microsoft.com/SQLServer/. If the suggestion mentioned by customers for many times, the product team may consider to add the feature in the next SQL Server version. Your feedback is valuable for us to improve our products and increase the
level of service provided.
If you have submit a feedback, could you please post the thread there? It will be very beneficial for other community members who have similar questions.
Regards,
Alisa Tang
If you have any feedback on our support, please click
here.
Alisa Tang
TechNet Community Support -
Hello all.
I have line chart with the legend. This legend contain text with length more then 20 characters. The text cuts off by some characters from the end, for example, it should be
1. Test1Test2Test3
2. Test4Test5Test6
and it will be shown like
1. Test1Test2Te
2. Test4Test5Tes
Changes in legend config window in Answers and in file cordalayout.cxml don't work.
How else can I fix this problem?What OS is on your server? All browsers?
I'm actually getting the exact opposite situation as you, I created legend items with really long text and they aren't being truncated at all. Even if I set the truncate value. I'm on Windows Server 2K3 and the same version of OBIEE.
I'll keep testing to see if I can come up with something, but if someone else out there knows what's going on, I'd love to hear it.
-Joe -
JavaFX Update Line Chart on Tab pane
Hi all,
I am wondering can anybody help with this problem.
I have an application that can create a new tab when the LineChart FXML view is called by way of onMouseClicked event from a bar graph (using scenebuilder). However, I need this Line chart to update when the user clicks a new bar on the bar graph page to show this new data.
Initially the Line chart tab will open and display data from the first bar graph click and when I click another bar in Tab A (bar chart) if it has the same number of rows it will refresh the LineChart tab otherwise I get an error. Then if I try to load another line graph tab using a different bar graph as the source I get a child duplication error
(So tab A has a bar graph that calls tab B to represent data as a line graph, however it wont do it more then once when there is a different number of points to show)
(Also tab C, another Bar chart will not load a new tab) Exceptions below & Class detail below.
I am using clear() to empty the observable list I have which is used to populate the graph and table before it reads in the new data values
What is the proper way/ best way to dynamically add another tab and update the chart in the tab with new values? Any help would be appreciated.
I am getting the following exceptions:
Exception in thread "JavaFX Application Thread" java.lang.IndexOutOfBoundsException: Index: 11, Size: 7
at java.util.ArrayList.rangeCheckForAdd(ArrayList.java:661)
at java.util.ArrayList.add(ArrayList.java:473)
at com.sun.javafx.collections.ObservableListWrapper.doAdd(ObservableListWrapper.java:101)
at javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:151)
at com.sun.javafx.collections.VetoableListDecorator.add(VetoableListDecorator.java:320)
at com.sun.javafx.scene.control.skin.TabPaneSkin$TabHeaderArea.addTab(TabPaneSkin.java:854)
at com.sun.javafx.scene.control.skin.TabPaneSkin$TabHeaderArea.access$500(TabPaneSkin.java:659)
at com.sun.javafx.scene.control.skin.TabPaneSkin.addTabs(TabPaneSkin.java:276)
at com.sun.javafx.scene.control.skin.TabPaneSkin.lambda$initializeTabListener$463(TabPaneSkin.java:357)
at com.sun.javafx.scene.control.skin.TabPaneSkin$$Lambda$108/885312968.onChanged(Unknown Source)
at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
at javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:155)
at java.util.AbstractList.add(AbstractList.java:108)
at javafxapplication2.FXMLExecutionChartController$3.handle(FXMLExecutionChartController.java:262)
at javafxapplication2.FXMLExecutionChartController$3.handle(FXMLExecutionChartController.java:241)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3437)
at javafx.scene.Scene$ClickGenerator.access$7900(Scene.java:3365)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3733)
at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3452)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1728)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2461)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:348)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:273)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:382)
at com.sun.glass.ui.View.handleMouseEvent(View.java:553)
at com.sun.glass.ui.View.notifyMouse(View.java:925)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
at com.sun.glass.ui.win.WinApplication$$Lambda$37/1146743572.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafxapplication2.FXMLExecutionChartController$3.handle(FXMLExecutionChartController.java:263)
at javafxapplication2.FXMLExecutionChartController$3.handle(FXMLExecutionChartController.java:241)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3437)
at javafx.scene.Scene$ClickGenerator.access$7900(Scene.java:3365)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3733)
at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3452)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1728)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2461)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:348)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:273)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:382)
at com.sun.glass.ui.View.handleMouseEvent(View.java:553)
at com.sun.glass.ui.View.notifyMouse(View.java:925)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
at com.sun.glass.ui.win.WinApplication$$Lambda$37/1146743572.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Class Information:
//Call to the Line chart graph
n.setOnMouseClicked(new EventHandler<MouseEvent>()
@Override
public void handle ( MouseEvent e )
String s1 = dt.getXValue();
String s = s1.trim();
if ( baseHash.containsKey(s) )
String value = (String) baseHash.get(s);
String hashValue = value.substring(6, 38);
System.out.println(hashValue);
FXMLLineChartController.setHash(hashValue);
try
lineTab .setText("Line Graph (Rows Read)");
lineTab.setContent(FXMLLoader.load(getClass().getResource("/javafxapplication2/FXMLLineChart.fxml")));
Node aNode = (Node) e.getSource();
Scene scene = aNode.getScene();
thisTabPane = (TabPane) scene.lookup("#tabPane");
thisTabPane.getTabs().add(lineTab);
selectionModel.selectLast();
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
catch ( IOException ex )
Logger.getLogger(FXMLWrittenChartController.class.getName()).log(Level.SEVERE, null, ex);
//Line Chart controller
//Create the Graph
@FXML
private LineChart barChart;
public void populateGraph ()
System.out.println("Populate graph Line Chart");
final CategoryAxis xAxis = new CategoryAxis();
final NumberAxis yAxis = new NumberAxis();
ObservableList<XYChart.Series<String, Number>> barChartData = FXCollections.observableArrayList();
barChartData.clear();
baseHash.clear();
xAxis.setLabel("Query");
yAxis.setLabel("Number of Executions");
series1.setName("Data from User DB2 for Query " +getHash() );
for ( int i = 0; i < userLine.size(); i++ )
System.out.println(getHash() + " Usersize = " + userLine.size() + " base size " +baseLine.size());
series1.getData().add(new XYChart.Data<String, Number>(userLine.get(i).getBuildNumber(), (userLine.get(i).getDYN_Num_Executions())));
barChartData.add(series1);
barChart.setData(barChartData);Hi all,
I am wondering can anybody help with this problem.
I have an application that can create a new tab when the LineChart FXML view is called by way of onMouseClicked event from a bar graph (using scenebuilder). However, I need this Line chart to update when the user clicks a new bar on the bar graph page to show this new data.
Initially the Line chart tab will open and display data from the first bar graph click and when I click another bar in Tab A (bar chart) if it has the same number of rows it will refresh the LineChart tab otherwise I get an error. Then if I try to load another line graph tab using a different bar graph as the source I get a child duplication error
(So tab A has a bar graph that calls tab B to represent data as a line graph, however it wont do it more then once when there is a different number of points to show)
(Also tab C, another Bar chart will not load a new tab) Exceptions below & Class detail below.
I am using clear() to empty the observable list I have which is used to populate the graph and table before it reads in the new data values
What is the proper way/ best way to dynamically add another tab and update the chart in the tab with new values? Any help would be appreciated.
I am getting the following exceptions:
Exception in thread "JavaFX Application Thread" java.lang.IndexOutOfBoundsException: Index: 11, Size: 7
at java.util.ArrayList.rangeCheckForAdd(ArrayList.java:661)
at java.util.ArrayList.add(ArrayList.java:473)
at com.sun.javafx.collections.ObservableListWrapper.doAdd(ObservableListWrapper.java:101)
at javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:151)
at com.sun.javafx.collections.VetoableListDecorator.add(VetoableListDecorator.java:320)
at com.sun.javafx.scene.control.skin.TabPaneSkin$TabHeaderArea.addTab(TabPaneSkin.java:854)
at com.sun.javafx.scene.control.skin.TabPaneSkin$TabHeaderArea.access$500(TabPaneSkin.java:659)
at com.sun.javafx.scene.control.skin.TabPaneSkin.addTabs(TabPaneSkin.java:276)
at com.sun.javafx.scene.control.skin.TabPaneSkin.lambda$initializeTabListener$463(TabPaneSkin.java:357)
at com.sun.javafx.scene.control.skin.TabPaneSkin$$Lambda$108/885312968.onChanged(Unknown Source)
at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
at javafx.collections.ModifiableObservableListBase.add(ModifiableObservableListBase.java:155)
at java.util.AbstractList.add(AbstractList.java:108)
at javafxapplication2.FXMLExecutionChartController$3.handle(FXMLExecutionChartController.java:262)
at javafxapplication2.FXMLExecutionChartController$3.handle(FXMLExecutionChartController.java:241)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3437)
at javafx.scene.Scene$ClickGenerator.access$7900(Scene.java:3365)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3733)
at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3452)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1728)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2461)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:348)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:273)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:382)
at com.sun.glass.ui.View.handleMouseEvent(View.java:553)
at com.sun.glass.ui.View.notifyMouse(View.java:925)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
at com.sun.glass.ui.win.WinApplication$$Lambda$37/1146743572.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafxapplication2.FXMLExecutionChartController$3.handle(FXMLExecutionChartController.java:263)
at javafxapplication2.FXMLExecutionChartController$3.handle(FXMLExecutionChartController.java:241)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3437)
at javafx.scene.Scene$ClickGenerator.access$7900(Scene.java:3365)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3733)
at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3452)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1728)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2461)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:348)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:273)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:382)
at com.sun.glass.ui.View.handleMouseEvent(View.java:553)
at com.sun.glass.ui.View.notifyMouse(View.java:925)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
at com.sun.glass.ui.win.WinApplication$$Lambda$37/1146743572.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Class Information:
//Call to the Line chart graph
n.setOnMouseClicked(new EventHandler<MouseEvent>()
@Override
public void handle ( MouseEvent e )
String s1 = dt.getXValue();
String s = s1.trim();
if ( baseHash.containsKey(s) )
String value = (String) baseHash.get(s);
String hashValue = value.substring(6, 38);
System.out.println(hashValue);
FXMLLineChartController.setHash(hashValue);
try
lineTab .setText("Line Graph (Rows Read)");
lineTab.setContent(FXMLLoader.load(getClass().getResource("/javafxapplication2/FXMLLineChart.fxml")));
Node aNode = (Node) e.getSource();
Scene scene = aNode.getScene();
thisTabPane = (TabPane) scene.lookup("#tabPane");
thisTabPane.getTabs().add(lineTab);
selectionModel.selectLast();
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
catch ( IOException ex )
Logger.getLogger(FXMLWrittenChartController.class.getName()).log(Level.SEVERE, null, ex);
//Line Chart controller
//Create the Graph
@FXML
private LineChart barChart;
public void populateGraph ()
System.out.println("Populate graph Line Chart");
final CategoryAxis xAxis = new CategoryAxis();
final NumberAxis yAxis = new NumberAxis();
ObservableList<XYChart.Series<String, Number>> barChartData = FXCollections.observableArrayList();
barChartData.clear();
baseHash.clear();
xAxis.setLabel("Query");
yAxis.setLabel("Number of Executions");
series1.setName("Data from User DB2 for Query " +getHash() );
for ( int i = 0; i < userLine.size(); i++ )
System.out.println(getHash() + " Usersize = " + userLine.size() + " base size " +baseLine.size());
series1.getData().add(new XYChart.Data<String, Number>(userLine.get(i).getBuildNumber(), (userLine.get(i).getDYN_Num_Executions())));
barChartData.add(series1);
barChart.setData(barChartData); -
Adding New Data To Line Chart: New Data Does Not Inherit Previous Color Scheme
This has me very confused. Here's what's being done:
Right-click on existing chart
Select "Data..."
Add additional data in the dialog that pops up
Click check-mark
The chart appends more data to the existing lines on the line chart, as it should, however the newly created portion of one of the lines (new data) is not the same color as the line up to that point. The line color is #0084A9, but when the new data is entered the new data on that same line is represented in an ever so slightly darker blue.
Any guesses as to why that would be happening? I can manually chage it, but that's a hassle and shouldn't necessary - I wouldn't think, anyway. Any help would be appreciated.
Thanks!
Very Best,
Tanner CampbellOK looked at this closer, and seen your problem as acolor shift from PMS to a CMYK that was slightly off.
If you want to work with Hexadecimal colors, then you need to File>> Document Color Mode >> RGB, otherwise your colors won't stick but convert to cmyk and be off.
Your graph went through some editing and got corrupted. I copied and pasted your date into a new graph, and then used the testube to apply samples to get your colors back. Will send you an email with fixed file.
That’s the strangest thing. The color you’re seeing is #4e46ff, the color it should be is the color reflected in the legend: #0083a9
What’s extra interesting is that when I open it I see the legend color for the entire line. Then, when I add data, the section of the line that depicts the newly added data is #4e46ff …. So I have this two tone line. It’s intriguing that you opened this on a mac and this difference was presence, I wonder if that is in anyway a clue. Maybe the original document was created in RGB and the new data is on CMYK? Thoughts?
Maybe you are looking for
-
iphoto wont work
-
I have lots of MTS files stored on an external hard drive that I want to use in my iMovie films. Now, as you know, iMovie doesn't like them. I have bought iCoolsoft for converting my video files into any format I want but now I've got another problem
-
Why does my iphoto seem to get "stuck" a lot of the times when I try to exit it to the point where I have to "force quit" it and how do I fix the problem that causes it?
-
How I reset my iPad with a forgotten password
Frgot my password and don't know what to do
-
Hi, y'all Well, first sorry my English, I'm brasilian (all sayd). Second, I have a requirement on my job by now tha follows: - Authenticate the user (on the windows NT Domain) currently logged, grasp your user name and password and forward to do one