I am using Microsoft Visual Studio 2010 XtraReports package 1.0 and MVC DX11.2 Report Controls
I am working on producing various Bar Charts. I need to produce a horizontal bar chart and can see that there is a solution for DevExpress.XtraCharts.v12.1 but it uses XYDiagram.Rotated Property.
(see http://documentation.devexpress.com/#XtraCharts/DevExpressXtraChartsXYDiagram_Rotatedtopic)
This is not available for me in DX11.2
Can anyone suggest how horizontal bar charts be created either using the chart designer or in code?
Many thanks
Jeff
DX 11.2 also have same property. Check the following code snippet of DX 11.2 demos
if (settings.Diagram is XYDiagram) {
((XYDiagram)settings.Diagram).Rotated = options.Rotated;
Axis2D axisY = ((XYDiagram)settings.Diagram).AxisY;
axisY.Interlaced = true;
axisY.Title.Text = "Population, millions";
axisY.Title.Visible = true;
}
else {
XYDiagram3D diagram = (XYDiagram3D)settings.Diagram;
diagram.AxisX.Label.MaxWidth = 60;
diagram.AxisY.Interlaced = true;
diagram.RotationType = RotationType.UseAngles;
diagram.RotationOrder = RotationOrder.XYZ;
diagram.ZoomPercent = 140;
diagram.VerticalScrollPercent = 4;
}
Html.DevExpress().Chart(settings)
.Bind(Model)
.Render();
Check your DevExpress Demos folder for Chart
Demo(C:\Users\Public\Documents\DevExpress 2011.2
Demos\Components\ASP.NET\MVC\CS\MVCDemos\Views\Chart), there you will
get the partial view file name "BarViewsSideBySideStackedPartial"
which help to implement this.
Hope this help.
Related
I'm trying to replicate the bokeh latex example mentioned at https://docs.bokeh.org/en/latest/docs/user_guide/extensions_gallery/latex.html#userguide-extensions-examples-latex in jupyter notebook for LabelSet. I could see the katex.min.js being loaded from web console. However when the LatexLabel renders, it states katex not defined.
Katex JS doc says, it should be available globally once js is loaded.
import * as p from "core/properties"
import {LabelSet, LabelSetView} from "models/annotations/label_set"
declare const katex: any
export class LatexLabelSetView extends LabelSetView {
model: LatexLabelSet
render(): void {
const draw = this._v_css_text.bind(this)
const {ctx} = this.plot_view.canvas_view
const [sx, sy] = this._map_data()
for (let i = 0, end = this._text.length; i < end; i++) {
try {
draw(ctx, i, this._text[i], sx[i] + this._x_offset[i], sy[i] - this._y_offset[i], this._angle[i])
katex.render(this._text[i], this.el, {displayMode: true})
}
catch(e) {
console.log( 'Error: ' + e);
}
}
}
}
class LatexLabelSet(LabelSet):
__javascript__ = ["https://cdn.jsdelivr.net/npm/katex#0.11.1/dist/katex.min.js"]
__css__ = ["https://cdn.jsdelivr.net/npm/katex#0.11.1/dist/katex.min.css"]
__implementation__ = TypeScript(TS_CODE)
Also tried adding the script element into document root. No luck though.
export class LatexLabelSet extends LabelSet {
properties: LatexLabelSet.Props
constructor(attrs?: Partial<LatexLabelSet.Attrs>) {
super(attrs)
}
static init_LatexLabelSet() {
let jsNode = document.createElement('script')
jsNode.id = 'bokeh-katex-js'
jsNode.src = "https://cdn.jsdelivr.net/npm/katex#0.11.1/dist/katex.min.js"
let cssNode = document.createElement('link')
cssNode.id = 'bokeh-katex-css'
cssNode.rel= 'stylesheet'
cssNode.href = "https://cdn.jsdelivr.net/npm/katex#0.11.1/dist/katex.min.css"
document.getElementsByClassName('bk-root')[0].appendChild(cssNode)
document.getElementsByClassName('bk-root')[0].appendChild(jsNode)
this.prototype.default_view = LatexLabelSetView
}
}
Any directions would be helpful.
Bokeh 2.4 adds support for LaTeX (and MathML) to some elements in Bokeh directly (no need to use an extension). Currently, you can use LaTeX on axis labels, tick labels, div widgets, and paragraph widgets, and this also works in Jupyter notebooks. LaTeX support for more elements should be added soon. For more information about the new math text feature and how to use them, see the Bokeh 2.4 release blogpost, the new blackbody radiation example, and the Bokeh user guide!
Note from maintainers: Initial built in LaTeX support was added in version 2.4, see this new answer https://stackoverflow.com/a/69198423/3406693
As stated in https://docs.bokeh.org/en/latest/docs/user_guide/embed.html#components, this is not possible to achieve within the notebook.
It says
Note that in Jupyter Notebooks, it is not possible to use components and show in the same notebook cell.
Indeed, if you use the code below, it opens a new tab with the plot and the formula, but if you call output_notebook(), the text does not appear and the browser console throws Uncaught ReferenceError: katex is not defined.
p = figure(title="LaTex Demonstration")
p.line([0,0,1,1,0],[0,1,1,0,0])
latex = LatexLabel(text=r"e^{i\pi}+1=0",
x=0.4, y=0.55,
render_mode='css', text_font_size='16pt',
background_fill_alpha=0)
p.add_layout(latex)
show(p)
Working in new tab:
Not working inside notebook:
I am trying to design progressive doughnut chart. I have a problem like I am getting doughnut chart but not progressive.
Is it possible to design progressive doughnut chart using achartengine? If it is possible how to do? please anyone can help?
DefaultRenderer renderer = buildCategoryRenderer(colors);
renderer.setApplyBackgroundColor(true);
renderer.setShowLegend(false);
renderer.setScale((float)1.3);
renderer.setShowLabels(false);
renderer.setStartAngle(270);
//renderer.setBackgroundColor(Color.rgb(222, 222, 200));
renderer.setLabelsColor(Color.BLUE);
return ChartFactory.getDoughnutChartView(MainActivity.this,
buildMultipleCategoryDataset("Project budget", titles1, values),
renderer);
}
private MultipleCategorySeries buildMultipleCategoryDataset(String title,
List<String[]> titles1, List<Float> values) {
// TODO Auto-generated method stub
MultipleCategorySeries series = new MultipleCategorySeries(title);
int k = 0;
for (Float value : values) {
series.add(title, titles1.get(k), values);
k++;
I used this chart in one of my application which requires real time battery value tracking and showing using doughnut chart. so, i created an example project for this.
Demo Doughnut Chart
just download/import this example to your workspace and run.
I have problem with this chart of a Chart control in ASP.NET 4.0 programmatically
I can not show the values in the SeriesChartType FastLine.
I have added in the script:
Chart1.Series["Price"].IsValueShownAsLabel = true;
But the values are not shown.
What am I missing?
What's wrong with this code?
Thank you in advance.
My code below.
Chart1.Series.Add("Price");
Chart1.Series["Price"].YValueMembers = "Price";
Chart1.Series["Price"].ChartType = SeriesChartType.FastLine;
Chart1.Series["Price"]["LabelStyle"] = "Center";
Chart1.Series["Price"]["PointWidth"] = "0.85";
Chart1.Series["Price"].IsValueShownAsLabel = true;
Chart1.Series["Price"].Font = new System.Drawing.Font("Verdana", 9, FontStyle.Bold);
Chart1.Series["Price"].LabelForeColor = System.Drawing.Color.FromArgb(0, 0, 128);
Chart1.Series["Price"]["LabelStyle"] = "Top";
Chart1.Series["Price"].Color = System.Drawing.Color.FromArgb(153, 153, 255);
Chart1.Series["Price"]["PixelPointDepth"] = "1.0";
Chart1.Series["Price"]["DrawingStyle"] = "Cylinder";
Chart1.Series["Price"].BorderWidth = 3;
Chart1.Series["Price"].MarkerColor = Color.Red;
Marker and DataPointLabels are not supported for FastLine chart.
According to MSDN:
Some charting features are omitted from the FastLine chart to improve performance.
The features omitted include control of point level visual attributes, markers, data point labels, and shadows.
So if you want to show label/datapoints, use Line chart instead.
I have been trying to render a line chart using the basic asp.net Chart class. Whatever I do, it always renders a column chart.
Here is my code where I am binding a datatable to the chart.
var IEtable = (table as System.ComponentModel.IListSource).GetList();
var chart = new Chart(width: 1000, height: 1000)
.AddSeries(chartType: "Line").AddLegend("Key")
.AddTitle("Time Series Metric")
.DataBindCrossTable(IEtable, "Key", "Date", "Value");
Can anyone please help? I am been breaking my head with this thing since more than 12 hours now.
I'm building my charts slightly differently - perhaps because I'm building mine in MVC pages?
Anyway, I'm still using the MS Chart stuff - http://msdn.microsoft.com/en-us/library/ee410579.ASPX
I create my chart:
var chart = new Chart();
chart.Width = 900;
chart.Height = 500;
...lots more options...
then add my series one at a time....
chart.Series.Add(CreateDataSeries(id, "GI Lower", null, null, GetGILowerDataPoints));
chart.Series.Add(CreateDataSeries(id, "GI Upper", null, null, GetGIUpperDataPoints));
where CreateDataSeries sets the chart type like this:
Series seriesDetail = new Series();
seriesDetail.ChartType = SeriesChartType.Spline;
...
return seriesDetail;
Does that help at all?
Im working with MS chart control .net 4.0
CharTemp.Series[seriesName].IsValueShownAsLabel = true;
CharTemp.Series[seriesName].ChartType = System.Web.UI.DataVisualization.Charting.SeriesChartType.Line;
My chart may show 3-4 series depend on input data so i want to change the Forecolor of point label as the same as serie's line color.
Please tell me if there is a way to do it.
chartSellInArea.Series["AttaintoForecast"].ChartType = SeriesChartType.Line;
chartSellInArea.Series["AttaintoForecast"].Color = Color.Orange;
chartSellInArea.Series["AttaintoForecast"].IsValueShownAsLabel = true;
chartSellInArea.Series["AttaintoForecast"].LabelBackColor = Color.Orange;