How to change label position in EPPLUS doughnut chart? - asp.net

My doughnut chart has overlapped labels and it is unreadable. How to make the labels readable by moving them? Is there a property to set?

You can fix this by enabling legend like this,
var dougnutChartStyles = (ExcelPieChartSerie)doughnutSeries;
dougnutChartStyles.DataLabel.ShowCategory = false;
and
var excelDoughnut = worksheet.Drawings.AddChart("pieChart", eChartType.Pie3D);
excelDoughnut.Legend.Position = eLegendPosition.Right;
So, labels will display as legends, not in the chart itself.

Related

How to remove the title from a chart in TornadoFx

I have a scatterplot that I would like to fit into an existing view:
scatterchart("Test", NumberAxis(), NumberAxis()) {
}
But I would like to get rid of the title at the top to centre the scatterplot in its view.
I have tried to set the title to an empty string but to no avail:
scatterchart("", NumberAxis(), NumberAxis()) {
// I'm looking for a method like this:
title.isVisible(false)
}
My goal is to get rid of that empty space at the top of the chart for a uniform look.
I'm not even sure what the correct way would be in JavaFx. Let me know if I'm on the right track, cheers!
Set the title to null:
scatterchart(null, NumberAxis(), NumberAxis())
Alternatively:
scatterchart(x = NumberAxis(), y = NumberAxis())

D3.js: Why are my legend tick marks' text disappearing?

I have a linear-gradient legend for my map. The x-axis values are calculated based on the minimum
and maximum values from the underlying data. I adapted this legend from this website:
https://www.visualcinnamon.com/2016/05/smooth-color-legend-d3-svg-gradient.html
The legend shows up when user selects a "field condition" from the dropdownlist. However, when
user selects a "state" from a dropdownlist, all the tick marks' text disappear. Same thing when user
selects a "county" from another dropdownlist. I haven't had luck trying to figure this out.
I'm calculating the tick mark values (shows as text) as follows:
var dataRange = getDataRange();
var min = parseFloat(dataRange[0].toFixed(3));
var max = parseFloat(dataRange[1].toFixed(3));
var legendW = 160, legendH = 20;
//create tick marks
var legendX = d3.scaleLinear()
.domain([min, max])
.range([0, legendW]);
var axis = d3.axisBottom(legendX);
d3.select("#svgLegend")
.attr("class", "axis")
.attr("width", legendW)
.attr("height", legendH * 2)
.append("g")
.attr("id", "g-legend")
.attr("transform", "translate(2," + legendH + ")") //margin.left; height/2
.call(axis);
For working example, please see: http://realtimeceap.brc.tamus.edu
I just glanced at the code on the page you referenced the working example at and think I figured out the issue.
Here's the line that taking out the ticks from the legend SVG:
d3.selectAll("text").remove();
which is a part of the onChange function for $("#stateSelect").
Line number: 279 to be more specific (in index.html file)
I think you want to take out all the texts from the mainSVG i.e. with the id: svgMap2.
Changing the above selection will fix the issue. (for eg. if you have a class for the texts to be removed, use d3.selectAll('text.<classname>').
Hope this helps.
I figured out why it's "disappearing". The Web is a stateless medium. So, every time I changed selection from the dropdownlist, the svg refreshes and losses its current state. So I needed to re-create my legend for the state and county dropdownlists. But also, for the county dropdownlist, since there is a Zoom function, it meant that everytime I zoom to another county, I loss my map state again. So I moved the recreate legend function into the zoomedIn method (that is, AFTER the zoom state). It works now.

ChartControl: how to disable axis labels when no related series points?

Take a look at the screenshot: there are a few labels on both axis even though there is no related chart points. Can i configure chart control to show labels only when there is some data on chart (see second picture)?
Actual
Desired
If you want to customize the label with a specific axis value then you should handle the ChartControl.CustomDrawAxisLabel event. Please refer to the sample code snippet in the CustomDrawAxisLabel documentation article.
private void chartControl1_CustomDrawAxisLabel(object sender, CustomDrawAxisLabelEventArgs e)
{
AxisBase axis = e.Item.Axis;
if (axis is AxisY || axis is AxisY3D || axis is RadarAxisY)
{
//Put your condition at below two lines..
double axisValue = (double)e.Item.AxisValue;
if (axisValue == 0)
{
e.Item.Text = string.Empty;
}
}
}
Refer these for more information with change of point values:
Conditionally change a chart axis label not based on axis value

how to reduce number of tick label in javafx categoryaxis

I'm drawing a line chart with javafx categoryaxis. e.g. I have 100 points on the plot. As such, all of my tick labels are squished together, resulting in 100 bunched-up ellipses. All I want to do is render every tenth label. I've looked through the documentation but there doesn't seem to be any way to turn individual tick labels visible or invisible, or how to change the setting of the tick unit on a CategoryAxis.
or I have to redraw xAxis?
just got an idea, add number of invisible char into the categoryaxis, so that each xaxis is still 'unique'
if (i%5 == 0)
str = DateFormat.getDateInstance(DateFormat.DEFAULT).format(date);
else {
str = invisible;
invisible += (char)29;
}

Adding vertical line on xAxis in HighStock

I know I can plot horizontal lines on yAxis using plotLines, but how about vertical lines on xAxis?
Thanks!
In the same way as in the yAxis, you need to use plotLines
http://api.highcharts.com/highcharts#xAxis.plotLines
Highstock: http://jsfiddle.net/kZkWZ/
value: Date.UTC(2011,3,1),
Value should be js timestamp, because xAxis has datetime type.

Resources