Can we disable/enable tooltip dynamically in Livecharts? - wpf

I am using Livecharts in wpf to generate a multiple line chart. The number of lines can be varied from 1 to 30.
For now, I have added a default tooltip which displays all the y-axis values of the current x-axis position where cursor is hovered. So when I have 36 lines in the chart, a larger tooltip is displayed and it does look bad.
So, can I know whether there is any approach which we can enable the tooltip only when the number of lines is lesser that 10 (for an example) and disable when it is above 10?
Thank you!

Related

SSRS bar chart issue

I am trying to add one box and one line on x-axis. Please look at below bar chart.
I tried using stripline but I cannot set height for stripline. It goes till 100.
Is there any way I can do this?
Unfortunately, SSRS doesn't provide the functionality you're looking for. A stripline is the closest you can get to that, but like you said, you can't control its height. The only way you could simulate this behavior would be to use a Background Image for your stripline, but that may be more work than it's worth. It would require a lot of manual adjustment to get the image to line up on the chart.
I would add a series to the chart using the Stock chart (under Range). In the Series Properties I would set the High value to the height desired for your line (~52 in your example). Ideally this would come from a dataset value.
Set the Low, Open and Close values to 0.
Try two Stripe Lines. First, create the strip line which represents the vertical value you're after. In my case, I made one that was 50% of the graph height off of the Y-Axis.
Chart Properties:
Height of StripeLine:
Once the stripe line is the correct height for the chart, create a 'mask' stripe line along the X-axis that will cover the portion of the Y-axis line you want hidden.
Chart Propterites:
Width of Stripe Mask:
Using these methods, and some really clever expression writing, you should be able to make the line exactly as high, and as wide as you desire.

SSRS Chart series title not show all text

I make Chart Report using SSRS
I have problem is my long series label not show whole text For Example
if label is "Personal Computer" it's show "Personal C......"
see image below
and this is whole Chart area
it's have more space between legend and series label I want to use this space to show whole text like this
How to fix this problem ?
Thank you.
Kindly Add the Legend on Right side of the Bar chart and Check
You need to fix the Chart Area height so that it is approximately half the height of the chart. This then allows sufficient space for the x axis labels.
You also nee to set the minimum and maximum font sizes for the x-axis.
I suggest between 6 and 8 pt.
Try setting the label rotation to 90 degrees instead of 45 also make sure the x axis interval is set to 1 and not auto.
[ Also have a look at this article ]
(http://www.douglane.net/fit-chart-labels-in-ssrs/)

SSRS indicator sizing

When adding an indicator to a report as per the image, is it possible to have all the indicators the same size regardless of the cell size (so centre them all rather than stretching to fill the cell)
Use rectangles within the cells of the table: within these, objects can be easily sized to not take full height or width.
Yes, sizing the rectangles and their contents can be annoying. I don't try to do much of this with the mouse, I quickly fall back to the properties window where I can type position and size.
try clicking on the indicator area (default name ie GaugeReportItem) within GaugePanel. You will get Size and position in Properties on the right hand side where you can choose AutoLayout. This will in effect center and resize gauges based on the cell width, height and your settings.
Hope it helps.
Exporting SSRS report to Excel did not go as expected.
Report with indicators in rectangles exported to Excel was randomly adding 0 height rows between the records which was not what I wanted. My indicators where simple green ticks and red crosses, based on true false. I have tried everything I found out there, even a subreport for indicator. No luck...
Figured it out that the indicators randomly outgrows the parent item when you export it, just like a chart. Ended up with saving a tick and a cross as an image. Then used an image control(with fit proportional set) and embedded Image with conditional statement to pick specific image. Also added some padding not to overlap borders.
The only problem I could think of is if the background of the report is not white as I could not change the background color of the cell the Image is and there is no option for the Image background.
Hope this helps someone else.

How a Slider control in WPF can snap on specific values?

I want to create a slider, with values from 0 to 100 that I can slide like any other slider... but at position 30, 42 and 55 (for example) I want to snap to these values, to make easy to the user to stop the slider at them
edit: my solution was to have 2 slider, the first one is invisible, value 0 to 200, and the other one is the visible on, value 0 to 100
The visible one cannot be slide, only the the invisible. Like this i can make a gap, ex: when I'm between 50 and 75 on the invisible slider, it's equals to 50 on the visible one...
You have to override OnValueChanged. See this article DiscreteSlider - Adding Functionality with a Simple Control Subclass and then this artice Silverlight slider control that snaps for a detailed explanation.
Instead of using SmallChange, you would check where between your values the slider sits and snap to the nearest.

How to Print all the columns in silverlight datagrid

Im having 17 columns of datagrid in Silverlight. How can we print all columns in datagrid to print. Since there are more noumber of column, Im enabling Horizantal Scroolbar ,so tht user can scrollto lastcolumn easily.
During printing of silverligt datagrid, i could see contents which are shown in Silverlight Page , anything beyond scroll bar ,those images are cropped and not printed . Any solution for print all columns in datagrid even though beyond the screen width.
One more question, if i have datagrid with horizontal scrollbar enabled, datagrid.actualwidth always give 768 px but not from first column to last column width size
_mahens
If you can wait six months for Silverlight 5, then you can completely control the print layout and format it exactly the way you want. Until then I'm not sure if there is anything you can do.
You basically have 2 options here.
Shrink your datagrid using Scaling to make the whole grid fit on your page
Slice the grid into 2 grids (first half of the columns in the first grid, and the other half on the other), then print this as 2 separate pages. Of course you would have to take into account the height of the grid and print additional pages there as well if required.
Difficult? Yes, but achievable :)

Resources