none
How to show only one label pr. line in a line graph?

    Question

  • Hi

    I have a line graph
    Which shows the number of orders for various brands during a period of time.
    This is the specifications:

    Vertical Axis: # Orders

    Horisontal Axis: Date

    Sigma Values: Sum(OrderCount)

    Series Groups: BrandName

    I would like to show only one label (with the BrandName) pr. line.
    I would like to show this one label where the line for the brand hits its maximum.
    Can you help me about what kind of expression I shall write where to accomplish this?


    • Edited by rune0071 Thursday, July 04, 2013 6:52 PM missing pic
    Thursday, July 04, 2013 2:41 PM

Answers

  • Hi Rune

    Sorry I got the requirement all messed up. This is doable First you would need to get MaxOrders for each brand. You can make use of Partition function such as below. I have just taken sample data into a temp table OrdersByBrand

    SELECT        BrandName, Orders, ShippedDate,MAX(Orders) OVER(PARTITION BY BrandName) AS MaxOrders
    FROM            OrdersByBrand

    Once you have that you would need to put an expression in the Label properties to have them displayed only when it is less than MaxOrders which you can find below - 


    Regards,
    Karthik

    Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

    • Marked as answer by rune0071 Wednesday, July 10, 2013 9:14 AM
    Tuesday, July 09, 2013 4:41 AM

All replies

  • Could you elaborate on what you mean by One label per line? A mock up screen of what you want to get would be of help.

    Regards,
    Karthik

    Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

    Monday, July 08, 2013 5:08 AM
  • Hi Karthik
    Thank you for showing interest in my problem.
    In the above screenshot you see the various lines of my line chart.
    I would like to show just one label pr. line in my chart.
    I would like to show this one label at one of the markers of the individual lines.
    Preferably I would like to show the label where each line hits its maximum, though that might be too complex?
    The above text also explains about the values I am inputing into the chart.
    Monday, July 08, 2013 8:19 AM
  • Ok now I understand. Basically you are looking at series of charts per each group i.e. each brand name in your case. For this you would have to put the chart as part of Tablix/Matrix control. Group it on Brand Name. You can then make header/footer not to appear. You can refer this link that has similar such requirement.

    Regards,
    Karthik

    Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

    Monday, July 08, 2013 8:35 AM
  • Just worked on it myself and am able to get the report as per the instructions in the link I have specified.

    Here is the output- 

    Coming to highlighting the max value on the chart. There are couple of properties you can make use of report properties such as #MAX as mentioned in this link to get the maximum value in your series. This is only applicable for ToolTips, custom Legend Text i.e. Here is an example of assigning Highest value to Tooltip.

    I wasn't able to get highlighting on the graph itself. Hope it helps.

    Note-Even line colors per graph can be edited by assigning expressions.


    Regards,
    Karthik

    Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.


    • Edited by V Karthik Monday, July 08, 2013 12:51 PM Added info
    Monday, July 08, 2013 12:50 PM
  • Hi Karthik

    Thank you for your effort.
    I already have my chart, on the picture above.
    I have no intention of making more charts.

    What I would like to do is to display One Data Lable for each line in my chart diagram.

    When we Right Click on the graph -> Show Data Labels, the graph shows many data labels, but I just want to show one.
    And preferably I would like to show that one Label where the Chart line peaks.

    I find it a little difficult to see your solution as doing that?
    • Edited by rune0071 Tuesday, July 09, 2013 10:35 AM edit
    Monday, July 08, 2013 6:45 PM
  • Hi Rune

    Sorry I got the requirement all messed up. This is doable First you would need to get MaxOrders for each brand. You can make use of Partition function such as below. I have just taken sample data into a temp table OrdersByBrand

    SELECT        BrandName, Orders, ShippedDate,MAX(Orders) OVER(PARTITION BY BrandName) AS MaxOrders
    FROM            OrdersByBrand

    Once you have that you would need to put an expression in the Label properties to have them displayed only when it is less than MaxOrders which you can find below - 


    Regards,
    Karthik

    Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

    • Marked as answer by rune0071 Wednesday, July 10, 2013 9:14 AM
    Tuesday, July 09, 2013 4:41 AM
  • Wow Mr. V. Karthik! :D

    You have done a very nice work!

    Excellent! You are good!

    My graph is now very beautiful, showing just the labels I want, just where I want them.

    Thank you!

    Wednesday, July 10, 2013 9:14 AM