w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
d3.js: Align text labels between ticks on the axis
There is no easy (i.e. built-in) way of doing this, but you can still achieve it. There are a few options. The most straightforward one is probably to use the tickFormat function to specify a format with a suitable number of spaces in front/after the numbers. This would need to be hand-tuned for each application though. Alternatively, you could select the label elements after they have been drawn and add a suitable transform attribute that shifts them accordingly. Again, this would have to be hand-tuned. Your third option is to have two different axes, one for the ticks and one for the labels. The idea is that the axis that provides the ticks has no labels and the other one no ticks. You would need to set the tick values appropriately, but at least you wouldn't have to guess the right of

Categories : D3 Js

High charts queue chart updates after ajax with multiple charts in firefox
you can do something like var objs=[];//array for addPoint function doAjax(obj) { var series = obj.series[0]; var x_val = (new Date()).getTime(); var y_val = Math.random(); var data = { json:"{"x": "+x_val+", "y": "+y_val+"}" } $.ajax({ url:"/echo/json/", data:data, type:"POST" }) .done(function(result){ console.log(result); if(objs.length<$(".charts").length){ objs.push(function(){series.addPoint([result.x, result.y], true, true)}); } if(objs.length==$(".charts").length){//all data loaded $.each(objs,function(i,n){ n();//call each addPoint

Categories : Jquery

How to arrange multiple charts from Google Charts in a grid in a local web page?
You cannot embed an Apps Script UI in an external website that is not hosted on Google Sites. There is currently an open issue in the issue tracker for this. Please star the issue to register your interest.

Categories : Google Apps Script

how to create bell graph using google charts or any other charts and fill multiple colors inside the curve
If you want "strange" graphics, I recomend you to create yourself the SVG file: Google charts draw images using vectorial images in SVG format. SVG format is a XML/DOM format that you may edit dynamically using Javascript DOM functions (like for HTML). You have 2 options: Use the Google charts and edit the resulting image. Create yourself all the charts. You may find an introductory tutorial for SVG format at: www.w3schools.com

Categories : Javascript

Multiple d3 charts on one page
I would recommend wrapping the entire generating code in a function which specifies which DOM element you want to put the chart in as a parameter. This will leverage javascript closure and everything should work itself out.

Categories : Javascript

Highcharts - multiple charts
It seems that the only way to do this is to have a container by chart. In my own opinion, I don't think a multi-div approach is a bad idea. Just be careful about the id you will give to the div. But you can create a clean code, on the javascript side. When you create many charts (6 or 8 is a lot...), you have to avoid code duplication... (At least to limit duplication) There is a good way to do this with jQuery.extend() and Highcharts.setOptions : Manage multiple highchart charts in a single webpage

Categories : Highcharts

D3 - Nesting multiple charts from the same dataset
It's not clear what you're trying to accomplish here. Do you have a table with a td element with class "sparkline" already in the DOM, and you're trying to add a new table inside it? Or do you want a new table somewhere else? Do you want one cell per number in your matrix, or one cell per row in the matrix? This fiddle illustrates the above choices: http://jsfiddle.net/nrabinowitz/ma7Dn/ In the first version, the code is as you've provided it, and there's an existing table in the DOM with a td.sparkline element to append new content to. The result is a new table within that td, with rows and cells corresponding to your matrix structure. In the second version, we're appending a new table to a different element, with one row per row in the matrix and one cell per row: var tr2 = d3.sele

Categories : D3 Js

D3.js - Donut charts with multiple rings
Yes, you can do this quite easily. The key is to use nested selections. That is, you pass in your top level list of lists and create a container element for each list. Then you do the nested selection and draw the actual elements. In this particular case, you also need to adjust the radii of the arcs so that they don't overlap. var gs = svg.selectAll("g").data(d3.values(dataset)).enter().append("g"); var path = gs.selectAll("path") .data(function(d) { return pie(d); }) .enter().append("path") .attr("fill", function(d, i) { return color(i); }) .attr("d", function(d, i, j) { return arc.innerRadius(10+cwidth*j).outerRadius(cwidth*(j+1))(d); }); Updated jsfiddle here.

Categories : Javascript

Jfreechart:displaying multiple charts
The following is more to get you started. Better use a GUI editor like that of the NetBeans IDE. Mind the following is typed, without seeing a compiler. Fields: private static final int CHARTS = 6; private int currentChartNo = 0; private JButton previousButton = new JButton("<"); private JButton nextButton = new JButton(">"); private JPanel currentChartPanel = new JPanel(); private JPanel[] chartPanels = new JPanel[CHARTS]; Initialisation in the frame: // getContentPane(), having per default a BorderLayout. add(currentChartPanel , BorderLayout.CENTER); add(previousButton, BorderLayout.WEST); add(nextButton, BorderLayout.EAST); previousButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event) { if (currentChartNo >

Categories : Java

Google Charts How to redraw Charts based on its Type been provide as a list?
There is currently no control that will let you change the chart type of a chart, so your (1) is not possible. However, you should be able to make that change yourself outside of controls. What you tried could potentially work, but I don't see where you specified the data. E.g. barChart.setDataTable(myTable); The view_spec that you provide to setView() must contain the entire view, since you are replacing whatever had been specified previously. Alternatively, you can just call setChartType() to change the type of the chart in the chart wrapper, like this: barChart.setChartType('LineChart'); barChart.draw() The docs for ChartWrapper are at: https://google-developers.appspot.com/chart/interactive/docs/reference#chartwrapperobject

Categories : Javascript

Highstocks 1M Zoom not active
Look at this http://jsfiddle.net/Bun72/1/ What you are seeing here is range of July 22nd to August 26th. In this example I'm using selected:0 which basically means 1m. BUT as your data do not have sample for August 22nd, highstocks is rendering nearest range of 1m depending upon the data which you have provided which comes down to the range of July 22nd to August 26th. This technically is not 1m, hence '1m' is disabled in your chart. And look at this http://jsfiddle.net/Bun72/2/ I have changed your data to [1369065600000,200,220], [1369670400000,220,240], [1370275200000,230,250], [1370880000000,240,260], [1371484800000,250,270], [137208960

Categories : Highcharts

VBA code which goes through multiple columns and builds charts of them
Your question is pretty broad, but in your comment, you ask more specifically "how to create a scatter plot chart that I can refer to later by its name." As far as I know, the process of giving a name to a chart is a bit awkward in Excel. The only way I found to do it is to activate the chart by clicking on it, then go in the VBA editor's Immediate window, and type: ActiveChart.Parent.Name = "My scatter plot" ' or whatever name Then, assuming you haven't deleted your chart, you can refer to it within your code like this: Dim cho As chartObject Dim cht As Chart Set cho = Sheet1.ChartObjects("My scatter plot") Set cht = cho.Chart This is assuming it is on Sheet1. Adjust as appropriate. Then you can add series to it like this: Dim ser As Series Set ser = cht.SeriesCollection.NewSerie

Categories : Excel

How do I display multiple charts automatically with PHP and MYSQL?
Mmmm, i think you code is almost correct, but, from where you get the fields etc, test and junk? i try your code, using mysqli, i guess is the same you are using, but your query never returns this data. if you changue data: [ <?php echo $row["wins"] . ", " . $row["losses"] . ", " . $row["etc"] . ", " . $row["test"] . ", " .$row["junk"] ?>], for: data: [ <?php echo $row["wins"] . ", " . $row["losses"] . ", " . $row["losses"] . ", " . $row["losses"] . ", " .$row["losses"] ?>], this work for me. i hope this helps you. Good Luck.

Categories : PHP

VBA set charts on multiple sheets invisible Excel
You could pass in a parameter that determines which graph should be visible each time. Then at the time you are selecting the graph type, you can call the function once, pass in the selected graph type, and it will turn that graph on and all others off, across all your sheets. Sub UpdateGraph(graphType As String) Dim ws As Worksheet For Each ws In Sheets For Each co In ws.ChartObjects '''Turn off all charts on the sheet first''' ws.ChartObjects(co.Name).Visible = False Next '''Turn on the one chart type we want''' ws.ChartObjects(graphType).Visible = True Next End Sub

Categories : Excel

Charts using Highcharts with multiple series from JSON
Your JSON is valid for a highcharts series - you don't need to try to transform it at all: $(document).ready(function() { var options = { chart: { renderTo: 'container', type: 'line' }, title: { text: 'PayOff Curve' }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle', borderWidth: 0 }, series: [] }; $.getJSON('data.json', function(list) { options.series = list; // <- just assign the data to the series property. var chart = new Highcharts.Chart(options); }); }); If that still doesn't work, open the console to see whether there's a JavaScript error. Here's a fiddle.

Categories : Javascript

How to update multiple highcharts charts with one function
Ths format: { "top10": { "data": "147,139,97,89,63,51,44,41,41,28", "xlabel": "a, b, c, d, e, f, g, h, i, j" } } is not compatiable with Highcharts, could you change to this? { "top10": { "data": [147,139,97,89,63,51,44,41,41,28], "xlabel": ['a', 'b', 'c', 'd','e', 'f', 'g', 'h', 'i', 'j'] } } Then your code should look like: $.getJSON("index.php/ajax",{start:date},function(data){ var top = $('#top10').highcharts(), all = $('#all').highcharts(); top.xAxis[0].setCategories(data.top10.xlabel, false); top.series[0].setData(data.top10.data); all.xAxis[0].setCategories(data.all.xlabel, false); all.series[0].setData(data.all.data); });

Categories : Jquery

Multiple charts Styling - individual Color
Ok I've found a solution! In the Background there is the generic.xaml where you can find the default Style of the Bubbledatapoint (You can find this here ). As i read through this if found the Palette resource. Later i tried to bind on those colours until i found the trick! Just set the fill property of the ellipse to {DynamicResource Background}" !

Categories : C#

Highcharts/Highstocks: Chart disappears when value is 0
It looks like you are having division by zero errors. You should make sure that the denominator is not zero. For example: var arpu = parseFloat(record['sales'])/parseFloat(record['dau']);

Categories : Javascript

Creating a powerpoint with multiple charts on each slide from excel using vba
First change you ForEach loop to For For i = 1 To ActiveSheet.ChartObjects.Count Set cht = ActiveSheet.ChartObjects(i) Then put condition before creation of slides: chartNum = (i - 1) Mod 4 If chartNum = 0 Then newPowerPoint.ActivePresentation.Slides.Add newPowerPoint.ActivePresentation.Slides.Count + 1, ppLayoutTitle End If Then, put logic for placing charts on each slide : If chartNum = 0 Then newPowerPoint.ActiveWindow.Selection.ShapeRange.Left = 50 newPowerPoint.ActiveWindow.Selection.ShapeRange.Top = 50 ElseIf chartNum = 1 Then newPowerPoint.ActiveWindow.Selection.ShapeRange.Left = 300 newPowerPoint.ActiveWindow.Selection.ShapeRange.Top = 50 ElseIf chartNum = 2 Then newPowerPoint.ActiveWindow.Selection.ShapeRange.Left = 50

Categories : Excel

Highcharts multiple charts refresh on a single click
To add events on a chart use: chart: { events: { click: function( ) { // reset charts } } } To reset charts use the same function for all charts which you are already using for a one chart.

Categories : Javascript

Multiple Google Charts inside JQuery Cycle
I guess the answer is very basic. I'm not a java person. I searched and thought about it. The answer, which I found on another site is: <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> function drawCharts() { var data1 = google.visualization.arrayToDataTable(<% = jsostring%>); var options1 = { title: 'PSNL Weight Chart', backgroundColor: {fill:'none'} }; var data2 = google.visualization.arrayToDataTable(<% = jsostring2%>); var options2 = { title: 'PSNL Sleep Chart', backgroundColor: {fill:'none'} }; var chartA = new google.visualizatio

Categories : Javascript

Automate creation of charts in multiple excel files?
For this sort of problem I would start by recording a macro of the steps you take manually into a personal macro workbook. You can then look at the code produced by Excel and you may find that you don't need to make too many changes for this to be useful as a generic procedure. After testing, if you wanted to take the automation one step further you could write a little procedure to loop through all of the Excel files in a directory and call your chart procedure for each file when it is open. I can dig out come code I wrote doing something similar if it will help. Update Here is a thread where I have provided some code to loop through all of the files containing some given text (in this example ".pdf" but could just as easily be ".xls" to cover xlsx, xlsm etc). Also this example prints

Categories : Excel

highstocks, how can I bring values that I will only use on the 'click' option?
You can use objects for points. data:[{ y:10, additional:'myparametervalue' },{ y:10, additional:'myparametervalue' }] Edit: Found an answer, with an example and more info about how do it from a similar question.

Categories : Highcharts

Creating multiple charts and the relation between Chart, Series, ChartArea
Series are associated with chart areas like so Chart Chart0 = new Chart(); ChartArea ChartArea0 = new ChartArea("name"); Chart0.ChartAreas.Add(ChartArea0); Series Series0 = new Series(); Chart0.Series.Add(Series0); // link series to area here Series0.ChartArea = "name";

Categories : C#

JQPlot pie charts "jqplotDataClick" event fires multiple times
Before adding your bind function, unbind corresponding event : $('#' + chartName).unbind('jqplotDataClick'); $('#' + chartName).bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) { alert('chartName:' + chartName + ' Data - ' + plot2.series[seriesIndex].data[pointIndex]); fetchData(plot2.series[seriesIndex].data[pointIndex].toString(), chartName); });

Categories : Jquery

Having Highcharts render bar/column charts with multiple colors by default
A couple of issues here... (1) "By default on the Highcharts site, all the lines on a bar/column chart are a different color." This is not true. The opening page of the highcharts website has a column chart, and all the columns have the same color. http://www.highcharts.com/ (2) When you implement a bar chart on your site, do you have just one series or multiple objects in your series? My guess is you have just one object in your series, in which case it makes sense that the one series would be coded in just one color by highcharts. (3) Open one of the highcharts examples in jsfiddle. http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/bar-basic/ Change the data so that this: series: [{ name: 'Year 1800',

Categories : Javascript

Unwanted bold-face while putting multiple ggplot charts in the same file
My intuition is that it's not actually being printed in bold, but rather double-printed for some reason, which then looks bold. This would explain why it doesn't come up with a simpler example. Especially given your mention of nested functions and probably other complicated structures where it's easy to get an off-by-one or similar error, I would try doing something where you can see exactly what's being plotted -- perhaps by examining the length() of the return value from apply(). Changing the order of elements of the vector, so that the order of the elements in the key is different, may also help. If you consistently get the bold-face on the last element, that also tells you a little bit more about where something is going wrong. As @Dinre also mentioned, it could also be related to y

Categories : R

Highstocks: Move Renderer elements along with navigator/ Draw Trendlines
Rendered object's position is basend on pixels, so when you use navigator, pixels "are the same" so object stay in the same position. But you can catch navigator "sliding" by setExtremes and aftersetExtremes functions and then move element by translate(). Simple example of using translate(): obj.translate(120,20); http://jsfiddle.net/Ne7QV/1/ Only what you need is common both elements, according to your expectations.

Categories : Javascript

How to import multiple csv files (of identical format) and create charts automatically in a Google Spreadsheet?
For an example. I take a FileIterator, a Spreadsheet and put them all to the spreadsheet by sheet. Code.gs function main() { var files = DriveApp.getFolderById(FOLDER_ID).getFilesByType('text/csv'); var csver = new CSVer(); csver.setSpreadsheet(SpreadsheetApp.openById(SPREADSHETT_ID)); csver.importFiles(files, newChart); } function newChart(sheet) { var chartBuilder = sheet.newChart(); chartBuilder.setChartType(Charts.ChartType.TABLE).addRange(sheet.getDataRange()).setPosition(1, 3, 1, 1); sheet.insertChart(chartBuilder.build()); } CSVer.gs var CSVer = function() { var spreadsheet_ = null; this.setSpreadsheet = function(spreadsheet) { spreadsheet_ = spreadsheet; return this; } this.importFile = function(file, funct) { try { var csv = file.ge

Categories : Google Apps Script

How to draw multiple lines in a line chart drwan using PHP, MySQL and Google Charts tool?
For one thing, you're referencing data2 and data3, but never setting them. You have three var data1 statements in a row. Update: I think that unless there is an undocumented concat method of DataTable that merges in the data from other DataTable instances, you're going to need to either implement such a function yourself or create the merged constructor argument in your php code. I'm not sure why the .concat call isn't raising an error, though. Perhaps the DataTable instance is an array.

Categories : PHP

How to iterate multiple cross-references?
With xslt-1.0 you may use a recursive template call to split up the ids. Try something like this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:key name="linkId" match="s" use="@id"/> <xsl:template match="/DIV"> <html> <head> <title>Test</title> </head> <body> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="link"> <ul> <li> <xsl:call-template name="findtarget"> <xsl:with-param name="targets" select="@target" /> </xsl:call-template>

Categories : Xml

Multiple charts with event listeners - how to find which chart has fired the listener? Test case and screenshot are attached
As far as I can tell, you are very nearly there with Update 2. Try : google.visualization.events.addListener(chart, 'select', (function(c) { return function() { alert(c); }; })(csv));

Categories : Javascript

How to align multiple divs in another?
It looks much more like a table than divisions to me... <table class="header"><tr> <td class="left"></td> <td class="center"> <img class="logo" src="linktomyimage.com/image.png" /> </td> <td class="right"></td> </tr></table> Think about so CSS afterwards : table.header{ width: 100%; border-collapse: collapse; } table.header td{ vertical-align: top; border: 1px solid #404040; } table.header td.center{ width: 800px; height: 600px; } This is just a code sample, get the idea, and adapt to your own needs ^^

Categories : CSS

how to align multiple div horizontaly
Aha! Saw your edit now! It's really simple with some css3 table display properties, but that doesn't work in old browsers. However, you could use some simple css to make a standard blog template with sidebar, header and main content: <style> .body-wrapper { position:absolute; top:20px; left:50%; width:900px; margin-left:-450px; /* Half the width (negative) */ background:red; } .header { position:relative; width:100%; height:100px; margin-bottom:10px; background:blue; } .main { float:left; width:70%; background:green; } .sidebar { float:right; width:30%; background:yellow; } </style> <div class="body-wrap

Categories : CSS

Cross-domain tracking with multiple profiles
First dot: not quite sure but I would assume: No, exit on the first, entry on the second domain, separate unique visitors. Second dot: There's a "secondary dimension" in the content report which offers "Hostname" as a breakdown - probably what you're looking for.

Categories : Javascript

Vertical align multiple lines of li
I think all you needed to do was set the height of the UL to auto. ul { margin: 0; padding: 0; width: 500px; height: auto; background: lightblue; text-align: center; list-style: none; vertical-align: middle; line-height: 100px; } Take a look at the JS Fiddle and see if that does what you were looking to do.

Categories : CSS

Why javafx based charts take more memory as compared to swing based charts
1) JavaFX charts will always consume quite a bit more memory than JFreeChart because the nodes on the charts are active parts of the scene graph. That is, every dot in a scatter chart is a node that can react to input events, do custom rendering, perform an animation or even play a video file. JFreeChart, on the other hand, renders the charts statically. Whether one or the other is beneficial to your application depends on the use case, but the JavaFX approach definitely uses more memory. 2) It appears that the current handling of CSS in JavaFX could still use some optimization. I am basing this statement solely on experience, but at least for all my tests the overhead there was a consistent overhead. 3) All that being said, 2.5GB vs. 400MB seems to be way too much. Could you post a smal

Categories : Java

Postgresql : How to join with multiple cross-reference table?
You have to explain what result you want to have. For example the following SQL is valid from syntax point of view, not sure about business point of view: -- this will create sample data with 5 tables with crossref1(ref_id) as (VALUES (1),(2),(3)), crossref2 (ref_id) as (VALUES (2),(3),(4)), table1 (ref_id) as (VALUES (3),(4),(5)), table2 (ref_id) as (VALUES (1),(2),(3)), table3 (ref_id) as (VALUES (1),(2),(3)) -- valid SQL based on your example select * from crossref1 cross join crossref2 join table1 on table1.ref_id=crossref1.ref_id join table2 as t2_1 on t2_1.ref_id=crossref1.ref_id join table2 as t2_2 on t2_2.ref_id=crossref2.ref_id join table3 on table3.ref_id=crossref2.ref_id With your SQL there are two problems: You have two references to table2, you have to add alias You

Categories : Postgresql

Cross Device Devlopment for Windows Devices - multiple sdk's?
I think this is exactly what you need. Windows Phone 7/8 and Windows 8 Co-development. You should separate you code, move platform independent logic to PCL. You'll have to develop different UIs for WP and WinRT anyway.

Categories : C#

How can I set a string's multiple argument to align center?
Unfortunately, this is not supported natively by String.Format. You will have to pad your string yourself: static string centeredString(string s, int width) { if (s.Length >= width) { return s; } int leftPadding = (width - s.Length) / 2; int rightPadding = width - s.Length - leftPadding; return new string(' ', leftPadding) + s + new string(' ', rightPadding); } Usage example: Console.WriteLine(string.Format("|{0}|", centeredString("Hello", 10))); Console.WriteLine(string.Format("|{0}|", centeredString("World!", 10)));

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.