Does anyone know how to put a margin at the top of the chart? I don't know if it's possible or a bug.
I already tried to modify the .margin({top: x, right: x, bottom: x, left: x}) but this is not the margin that I'm looking for. Setting the chart.yDomain() isn't good because I want the chart to rescale.
EDIT
My interest is that the linewithfocuschart rescale, not just force the domain.
The issue seems to be when the tooltip appears at the highest point in the chart. Maybe a bug, not really sure.
But here's one way of doing it, might not be the best way:
chart.forceY([0,160]);
By looking at your chart I'm assuming that 140 is the highest value in you chart. So I'm forcing the Y axis on the chart to show values between 0-160.
Update
Earlier I suggested the use of chart.forceY([0,160]); as a work around to adding margin to the chart top so the tooltips are clearly visible with the highest points. Although this approach only makes changes to the main chart and not the focus chart.
After some further investigation, I found out that you could use the following to rescale the chart and the focus:
chart.lines.forceY([0, yMax])
chart.lines2.forceY([0, yMax])
Here's a working example of using with a NVD3 lineWithFocusChart(). I have also got the yMaxdynamically in line 15 of my code.
Related
I have 4 charts created in SSRS 2017 and I need them to be the same size.
Are there any settings (and where? in SSRS) to make size all the same for all of my 4 charts?
When I go into Chart Area properties, there is nothing about the chart size...
Please help!
Update:
When I clicking on the Chart Area slightly outside the actual chart I see the following Chart Properties:
You can control the position of the chart area and the plot position of the pie within the area by setting the CustomPosition and CustomInnerPlotPosition properties. Select the chart area first to see these properties.
Please note: You must select the CHART AREA object in the designer not the chart Just click slightly outside the pie to select the correct area then you will see these properties.
You can do the same for the legend too if required so you can get full control over the final rendered size.
It does take a bit of trial and error to get a layout that suits all your needs but it can be done.
You cant directly influence the size of the chart, like Hannover Fist said it depends on multiple conditions (for example the legend). What you can do is to put the legend on top or on bottom of the chart (the reason for the different sizes of your charts it that the legend text from right to left is different, thus it uses the space from the visual). This way the size of the chart should be more or less the same size. Right click on your legend Legend properties > General > Legend position. With the MaxAutoSize property from the legend you can a little bit control the size of your legend.
To your second question. No, a chart (also tablix and matrix) can only have one Dataset as source. You can see this in the chart properties at the drop down list. You just can chose one element. But you can create one big dataset with all the data for the different charts. Then assign this dataset to one chart and copy it. And then you set different filters to the charts.
For me the above didn't help. The varying sizes of pie charts related to the fact that some had been set to have their series value > label > position = outside and others were position = auto. All pie charts had their labels hidden so you coudln't see them at all but SSRS was allowing space for them when set to position = outside. This made it extremely frustrating to chase down where the difference in size was coming from. Hope this may help someone who comes across a similar issue.
In my never-ending quest to make my life easier, I've encountered something to make it more difficult.
Has anyone had any experience with why creating or editing objects in a Google Slide with Google Apps Script results in an inaccurate floating point version that's kinda close?
Example, creating an object:
SlidesApp
.getActivePresentation()
.getSlides()[0]
.insertShape(SlidesApp.ShapeType.RECTANGLE, 20, 20, 200, 200);
But the resulting rectangle has these properties:
Top: 20
Left: 20
Width: 200.00787401574803
Height: 200.00787401574803
And what's just as bad is the top and left 1px borders aren't pixel perfect as you'd expect given the correct top and left whole number value.
I discovered this because my first attempt at all this was to round the x/y,w/h to get shapes to at least be clean on the page, and that resulted in the same issues.
Some more digging shows 2 things.
1) These crazy floats (rounding errors) aren't the cause of the blurring of my objects on the slide. They can safely be ignored.
2) It seems the pixel values a slide has are a multiple of .375. So to move an object 1px to the right, you actually have to move it .375 to the right. If you want to round the values of a slide's objects, you need to round the result of the value * 2.66666, then multiply the result by .375.
Example:
pageElements[0].setTop(Math.round((pageElements[0].getTop() * 2.6666666666666))*.375);
So now the original goal of pixel-perfect editing of objects in a sidebar tool I create is now possible. Whew!
Following up on my question from yesterday:
SciChart - showing labels for all ticks
Thanks to the answer I was able to get the label density where I needed it. But I still have problems with label placement. As you can see in the screenshot, rotating the labels caused them to stick upwards into the graph. I need them below the axis. I've tried everything I could find in the API that I thought might help me:
a TranslateTransform - I tried moving both X and Y both ways. No
result.
VerticalAnchorPoint and HorizontalAnchorPoint - setting
VerticalAnchorPoint to Center actually moved the labels, but only by
3mm and in the wrong direction.
Horizontal/Vertical
Alignment/ContentAlignment - didn't do anything.
I've even tried
bloating the labels by appending a lot of spaces to the strings. A desperate attempt, I know.
Furthermore, the horizontal position of the labels is not correct either. In the screenshot you can see the first bump on the graph goes down on what looks like CF.02. But in reality it's set to CF.01. It would seem the labels are moved to the left of their corresponding tick. I need them to be displayed below the center of their respective tick, like the original solution.
[edit: image removed to prevent potential client IP issues]
In the SciChart's WPF Xaml Styling a Chart example there is a demonstration of how to rotate labels by changing the AxisBase.TickLabelStyle.
This uses RenderTransform to rotate labels by 15 degrees. However, if you use 90 degrees, the labels overlap the surface.
Changing the RenderTransform to LayoutTransform forces labels to be drawn in the correct place (below the axis).
You can read more about the difference between RenderTransform and LayoutTransform here.
I have a Stacked Area Chart in SSRS 2008 R2.
As you can see, the data labels are swallowed both left and right.
If I change the chart type to any area chart I have the same problem.
If I change to line type, it leaves space between the y axis and the chart.
Do you know any way around this?
I couldn't find a real solution to my issue. Playing with the Label, SmartLabels and NoMoveDirections properties didn't affect my chart at all - strange.
So I removed the axis and gave made the fill for the data labels as the corresponding areas. It looks like this:
Better than nothing...
By default, smart labels are placed in static positions. You can allow them to be moved by changing the NoMoveDirections properties. In your case, it looks like changing Left and Right to False should do the trick.
I have a dynamic chart where you cna change the chart in real time by dragging dots on the line, but since Visiblox have some kind of auto scale/zoom its quite unusable.
I've tried AutoScaleToVisibleData = false on the two axis, but it does not do anything... I have a ZoomBehaviour and still want to be able to zoom, but I do not want it to be auto
AutoScaleToVisibleData determines whether the scale on one axis should be dependent on the scale of another (e.g. only show a scale for the y-axis that encompases what is currently visible on the x-axis).
To fix the range (and disable auto-ranging) of the data you need to set an explicit range to the axis. See http://www.visiblox.com/blog/2011/03/visiblox-charts-ranges-demystified for more info.
Also you may want to have a quick look at http://www.visiblox.com/blog/2011/09/creating-a-custom-behaviour-part-1 since that sounds a bit like what you want?