Parsing JSON without square brackets around the arrays - json

I need to parse a live feed but each array has no brackets around it so I am slightly confused. It is also valid JSON as I used an online service to check. I want to specify the context and then grab the data. does anyone know how I can do this and what the context might be?
In this case I want the "Name", "competitor" and a few other fields. Any help gratefully received.
{
"604377": {
"competitors": {
"3521278": {
"Name": "Brazil",
"Jockey": null,
"Weight": null,
"Saddle": 0,
"Barrier": null,
"QLDWin": 0,
"VICWin": 0,
"NSWWin": 0,
"QLDPlace": 0,
"VICPlace": 0,
"NSWPlace": 0,
"DetailedPricing": {
"winTotePlus": false,
"placeTotePlus": false,
"topFluc": false,
"bestOfBest": false,
"bestOrSP": false,
"fixedOdds": false,
"fixedWin": true,
"doubleFixedWin": 0,
"bestOfEverythingWin": 0,
"bestAnytimeWin": 0,
"fixedPlace": true,
"startPriceGuarantee": 0,
"fixedEachWay": true,
"placePrices": [
0
],
"startPrice": false,
"internationalStartPrice": false,
"midToteWin": false,
"midTotePlace": true,
"topToteWin": true,
"topTotePlace": false,
"top2ToteWin": false,
"top2TotePlace": false,
"vicToteWinPlus1": false,
"vicTotePlacePlus1": false,
"vicToteWinPlus2": false,
"vicTotePlacePlus2": false,
"vicToteWinPlus5": false,
"vicTotePlacePlus5": false,
"vicToteWinPlus10": false,
"vicTotePlacePlus10": false,
"exoticBet": true,
"exoticMidTote": false,
"exoticBest2Tote": false,
"exoticBest3Tote": false,
"pickYourOdds": false,
"firstfour": true,
"midToteWinPrice": 0,
"midTotePlacePrice": 0,
"topToteWinPrice": 0,
"top2ToteWinPrice": 0,
"top2ToteOrSPWinPrice": 0,
"vicToteWinPlus1Price": 0,
"vicToteWinPlus2Price": 0,
"vicToteWinPlus5Price": 0,
"vicToteWinPlus10Price": 0,
"topTotePlacePrice": 0,
"top2TotePlacePrice": 0,
"vicTotePlacePlus1Price": 0,
"vicTotePlacePlus2Price": 0,
"vicTotePlacePlus5Price": 0,
"vicTotePlacePlus10Price": 0,
"topFlucPrice": 0,
"lastFlucPrice": 0,
"bestOfBestPrice": 0,
"bestOrSPPrice": 0,
"bestOrSPPlacePrice": 0.75,
"winDeduction": 0,
"placeDeduction": 0,
"competitor": 11863763,
"sport": "Soccer",
"saddle": 0,
"description": "Brazil 2014 - World Cup Winner ",
"team": "Jordan",
"win": 0,
"place": 0,
"numOutcomes": 24,
"numPlacings": 1,
"numWinners": 1
},
"Scratched": "no",
"RisaSilkID": null
},
"3521279": {
"Name": "Argentina",
"Jockey": null,
"Weight": null,
"Saddle": 0,
"Barrier": null,
"QLDWin": 0,
"VICWin": 0,
"NSWWin": 0,
"QLDPlace": 0,
"VICPlace": 0,
"NSWPlace": 0,
"DetailedPricing": {
"winTotePlus": false,
"placeTotePlus": false,
"topFluc": false,
"bestOfBest": false,
"bestOrSP": false,
"fixedOdds": false,
"fixedWin": true,
"doubleFixedWin": 0,
"bestOfEverythingWin": 0,
"bestAnytimeWin": 0,
"fixedPlace": true,
"startPriceGuarantee": 0,
"fixedEachWay": true,
"placePrices": [
0
],
"startPrice": false,
"internationalStartPrice": false,
"midToteWin": false,
"midTotePlace": true,
"topToteWin": true,
"topTotePlace": false,
"top2ToteWin": false,
"top2TotePlace": false,
"vicToteWinPlus1": false,
"vicTotePlacePlus1": false,
"vicToteWinPlus2": false,
"vicTotePlacePlus2": false,
"vicToteWinPlus5": false,
"vicTotePlacePlus5": false,
"vicToteWinPlus10": false,
"vicTotePlacePlus10": false,
"exoticBet": true,
"exoticMidTote": false,
"exoticBest2Tote": false,
"exoticBest3Tote": false,
"pickYourOdds": false,
"firstfour": true,
"midToteWinPrice": 0,
"midTotePlacePrice": 0,
"topToteWinPrice": 0,
"top2ToteWinPrice": 0,
"top2ToteOrSPWinPrice": 0,
"vicToteWinPlus1Price": 0,
"vicToteWinPlus2Price": 0,
"vicToteWinPlus5Price": 0,
"vicToteWinPlus10Price": 0,
"topTotePlacePrice": 0,
"top2TotePlacePrice": 0,
"vicTotePlacePlus1Price": 0,
"vicTotePlacePlus2Price": 0,
"vicTotePlacePlus5Price": 0,
"vicTotePlacePlus10Price": 0,
"topFlucPrice": 0,
"lastFlucPrice": 0,
"bestOfBestPrice": 0,
"bestOrSPPrice": 0,
"bestOrSPPlacePrice": 0.75,
"winDeduction": 0,
"placeDeduction": 0,
"competitor": 11863763,
"sport": "Soccer",
"saddle": 0,
"description": "Brazil 2014 - World Cup Winner ",
"team": "Jordan",
"win": 0,
"place": 0,
"numOutcomes": 24,
"numPlacings": 1,
"numWinners": 1
},
"Scratched": "no",
"RisaSilkID": null
},
"3521280": {
"Name": "Spain",

You haven't specified which language/platform you want to do this in. I'll assume .NET...
http://www.nuget.org/packages/newtonsoft.json/
WebRequest request = WebRequest.Create(query);
using (var response = request.GetResponse())
{
using (var responseStream = response.GetResponseStream())
{
using (var streamReader = new StreamReader(responseStream))
{
try
{
JsonReader reader = new JsonTextReader(streamReader);
dynamic result = JObject.Load(reader);
There's lots of other JSON parsers out there for .NET and other platforms

Related

Angular highcharts scroll not working while drag over the chart on mobile

I am using basic line Highcharts on my Angular 8 project. While I'm trying to use the system on the iPhone I can't scroll the page over the area where a chart is lying. Chart is preventing page scrolling from working. This is very annoying for instance when a chart is covering the whole screen, as there's no way to scroll the page in this case.
I am adding a code of my TS function
chartOptions = {
title: {
text: 'Your Net Worth'
},
yAxis: {
title: {
text: 'Money in GBP'
}
},
legend: {
align: 'center',
verticalAlign: 'bottom',
x: 0,
y: 0
},
credits: {
enabled: false,
},
plotOptions: {
series: {
label: {
connectorAllowed: false
},
pointStart: 2020
}
},
series: [
{
name: 'Net Worth',
color: '#00b300',
data: [latest_networth_for_chart]
}
, {
name: 'Age group (domestic) (coming soon)',
color: '#ff0000',
data: [0, 0, 0, 0, 0, 0, 0, 0],
visible: false
}, {
name: 'Age group (expats) (coming soon)',
color: '#0000b3',
data: [0, 0, 0, 0, 0, 0, 0, 0],
visible: false
},
{
name: 'Others in your industry (coming soon)',
color: '#0000b3',
data: [0, 0, 0, 0, 0, 0, 0, 0],
visible: false
},
{
name: 'Peer group (coming soon)',
color: '#0000b3',
data: [0, 0, 0, 0, 0, 0, 0, 0],
visible: false
},
{
name: 'Global average (coming soon)',
color: '#0000b3',
data: [0, 0, 0, 0, 0, 0, 0, 0],
visible: false
},
{
name: 'This time last year (coming soon)',
color: '#0000b3',
data: [0, 0, 0, 0, 0, 0, 0, 0],
visible: false
},
],
responsive: {
rules: [{
condition: {
maxWidth: 540
},
chartOptions: {
legend: {
layout: 'horizontal',
align: 'center',
verticalAlign: 'bottom',
enabled: false
}
}
}]
}
}
}
Am I did anything wring on my code?
Regarts, Faz.

DataGrip MySQL stores emojis correctly but displays them as?

I'm having trouble viewing emojis in JetBrains DataGrip. In the main editor, emojis appear just fine, as well as in SQLite database viewer. In MySQL however, they appear as ?
I've painstakingly had to figure out how to get emojis to store correctly in MySQL. I've followed many guides that tell you to make sure your server, client, connection, database, results, table, and column charsets are set to utf8mb4 and the corresponding collations to utf8mb4_unicode_520_ci. I've done this and still have the same results, i.e. MySQL displaying emojis as ?
I double checked the variables and got these results:
character_set_client utf8mb4
character_set_results utf8mb4
character_set_connection utf8mb4
character_set_server utf8mb4
character_set_database utf8mb4
collation_server utf8mb4_unicode_520_ci
collation_connection utf8mb4_unicode_520_ci
collation_database utf8mb4_unicode_520_ci
I then came across an answer on JetBrains' community that says you may have to cast the encoding like so:
UPDATE content SET data = (_utf8mb4 '😙😘')
WHERE message_id = 45291;
But still, the error persisted. I then found this little gem to show the actual hex code value of the column:
SELECT col, HEX(col), LENGTH(col), CHAR_LENGTH(col)
FROM table WHERE id = 1;
The result was the following:
col HEX(col) LENGTH() CHAR_LENGTH(col)
😙😘 F09F9899F09F9898 8 2
Well, sure enough, the data column shows the emojis. Note that these results are displayed in the console of DataGrip. And of course, the hex value corresponds to those emojis. I tested that with a converter.
That's great! The hard part is done. MySQL is storing my data correctly.
But when I go to the actual table in DataGrip, I still see the value as ??.
What am I doing wrong?
EDIT
Here are the environment variables used in connecting to my server:
{
"allowLoadLocalInfile": true,
"allowMultiQueries": false,
"allowNanAndInf": false,
"allowUrlInLocalInfile": false,
"alwaysSendSetIsolation": true,
"autoClosePStmtStreams": false,
"replicationConnectionGroup": "",
"allowMasterDownConnections": false,
"allowSlaveDownConnections": false,
"readFromMasterWhenNoSlaves": false,
"autoDeserialize": false,
"autoGenerateTestcaseScript": false,
"autoReconnect": true,
"autoReconnectForPools": false,
"blobSendChunkSize": 1048576,
"autoSlowLog": true,
"blobsAreStrings": false,
"functionsNeverReturnBlobs": false,
"cacheCallableStmts": false,
"cachePrepStmts": false,
"cacheResultsSetMetadata": false,
"serverConfigCacheFactory": "com.mysql.jdbc.PerVmServerConfigCacheFactory",
"cacheServerConfiguration": false,
"callableStmtCacheSize": 100,
"capitalizeTypeNames": true,
"characterEncoding": "UTF-8",
"characterSetResults": "UTF-8",
"connectionAttributes": "",
"clientInfoProvider": "com.mysql.jdbc.JDBC4CommentClientInfoProvider",
"clobberStreamingResults": false,
"clobCharacterEncoding": "",
"compensateOnDuplicateKeyUpdateCounts": false,
"connectionCollation": "",
"connectionLifecycleInterceptors": "",
"connectTimeout": 0,
"continueBatchOnError": true,
"createDatabaseIfNotExist": false,
"defaultFetchSize": 0,
"useServerPrepStmts": false,
"dontTrackOpenResources": false,
"dumpQueriesOnException": false,
"dynamicCalendars": false,
"elideSetAutoCommits": false,
"emptyStringsConvertToZero": true,
"emulateLocators": false,
"emulateUnsupportedPstmts": true,
"enablePacketDebug": false,
"enableQueryTimeouts": true,
"explainSlowQueries": false,
"exceptionInterceptors": "",
"failOverReadOnly": true,
"gatherPerfMetrics": false,
"generateSimpleParameterMetadata": false,
"holdResultsOpenOverStatementClose": false,
"includeInnodbStatusInDeadlockExceptions": false,
"includeThreadDumpInDeadlockExceptions": false,
"includeThreadNamesAsStatementComment": false,
"ignoreNonTxTables": false,
"initialTimeout": 2,
"interactiveClient": false,
"jdbcCompliantTruncation": true,
"largeRowSizeThreshold": 2048,
"loadBalanceStrategy": "random",
"serverAffinityOrder": "",
"loadBalanceBlacklistTimeout": 0,
"loadBalancePingTimeout": 0,
"loadBalanceValidateConnectionOnSwapServer": false,
"loadBalanceConnectionGroup": "",
"loadBalanceExceptionChecker": "com.mysql.jdbc.StandardLoadBalanceExceptionChecker",
"loadBalanceSQLStateFailover": "",
"loadBalanceSQLExceptionSubclassFailover": "",
"loadBalanceEnableJMX": false,
"loadBalanceHostRemovalGracePeriod": 15000,
"loadBalanceAutoCommitStatementRegex": "",
"loadBalanceAutoCommitStatementThreshold": 0,
"localSocketAddress": "",
"locatorFetchBufferSize": 1048576,
"logger": "com.mysql.jdbc.log.StandardLogger",
"logSlowQueries": false,
"logXaCommands": false,
"maintainTimeStats": true,
"maxQuerySizeToLog": 2048,
"maxReconnects": 3,
"retriesAllDown": 120,
"maxRows": -1,
"metadataCacheSize": 50,
"netTimeoutForStreamingResults": 600,
"noAccessToProcedureBodies": false,
"noDatetimeStringSync": false,
"noTimezoneConversionForTimeType": false,
"noTimezoneConversionForDateType": true,
"cacheDefaultTimezone": true,
"nullCatalogMeansCurrent": true,
"nullNamePatternMatchesAll": true,
"packetDebugBufferSize": 20,
"padCharsWithSpace": false,
"paranoid": false,
"pedantic": false,
"pinGlobalTxToPhysicalConnection": false,
"populateInsertRowWithDefaultValues": false,
"prepStmtCacheSize": 25,
"prepStmtCacheSqlLimit": 256,
"parseInfoCacheFactory": "com.mysql.jdbc.PerConnectionLRUFactory",
"processEscapeCodesForPrepStmts": true,
"profilerEventHandler": "com.mysql.jdbc.profiler.LoggingProfilerEventHandler",
"profileSql": "",
"profileSQL": false,
"propertiesTransform": "",
"queriesBeforeRetryMaster": 50,
"queryTimeoutKillsConnection": false,
"reconnectAtTxEnd": false,
"relaxAutoCommit": false,
"reportMetricsIntervalMillis": 30000,
"requireSSL": false,
"resourceId": "",
"resultSetSizeThreshold": 100,
"retainStatementAfterResultSetClose": false,
"rewriteBatchedStatements": false,
"rollbackOnPooledClose": true,
"roundRobinLoadBalance": false,
"runningCTS13": false,
"secondsBeforeRetryMaster": 30,
"selfDestructOnPingSecondsLifetime": 0,
"selfDestructOnPingMaxOperations": 0,
"replicationEnableJMX": false,
"serverTimezone": "",
"sessionVariables": ,
"slowQueryThresholdMillis": 2000,
"slowQueryThresholdNanos": 0,
"socketFactory": "com.mysql.jdbc.StandardSocketFactory",
"socksProxyHost": "",
"socksProxyPort": 1080,
"socketTimeout": 0,
"statementInterceptors": "",
"strictFloatingPoint": false,
"strictUpdates": true,
"overrideSupportsIntegrityEnhancementFacility": false,
"tcpNoDelay": true,
"tcpKeepAlive": true,
"tcpRcvBuf": 0,
"tcpSndBuf": 0,
"tcpTrafficClass": 0,
"tinyInt1isBit": false,
"traceProtocol": false,
"treatUtilDateAsTimestamp": true,
"transformedBitIsBoolean": false,
"useBlobToStoreUTF8OutsideBMP": false,
"utf8OutsideBmpExcludedColumnNamePattern": "",
"utf8OutsideBmpIncludedColumnNamePattern": "",
"useCompression": false,
"useColumnNamesInFindColumn": false,
"useConfigs": "",
"useCursorFetch": false,
"useDynamicCharsetInfo": true,
"useDirectRowUnpack": true,
"useFastIntParsing": true,
"useFastDateParsing": true,
"useHostsInPrivileges": true,
"useInformationSchema": false,
"useJDBCompliantTimezoneShift": false,
"useLocalSessionState": false,
"useLocalTransactionState": false,
"useLegacyDatetimeCode": true,
"sendFractionalSeconds": true,
"useNanosForElapsedTime": false,
"useOldAliasMetadataBehavior": false,
"useOldUTF8Behavior": false,
"useOnlyServerErrorMessages": true,
"useReadAheadInput": true,
"useSqlStateCodes": true,
"useSSL": false,
"useSSPSCompatibleTimezoneShift": false,
"useStreamLengthsInPrepStmts": true,
"useTimezone": false,
"ultraDevHack": false,
"useUnbufferedInput": true,
"useUnicode": true,
"useUsageAdvisor": false,
"yearIsDateType": false,
"zeroDateTimeBehavior": "convertToNull",
"useJvmCharsetConverters": false,
"useGmtMillisForDatetimes": false,
"dumpMetadataOnColumnNotFound": false,
"clientCertificateKeyStoreUrl": "",
"trustCertificateKeyStoreUrl": "",
"clientCertificateKeyStoreType": "JKS",
"clientCertificateKeyStorePassword": "",
"trustCertificateKeyStoreType": "JKS",
"trustCertificateKeyStorePassword": "",
"verifyServerCertificate": true,
"useAffectedRows": false,
"passwordCharacterEncoding": "",
"maxAllowedPacket": -1,
"authenticationPlugins": "",
"disabledAuthenticationPlugins": "",
"defaultAuthenticationPlugin": "com.mysql.jdbc.authentication.MysqlNativePasswordPlugin",
"disconnectOnExpiredPasswords": true,
"getProceduresReturnsFunctions": true,
"detectCustomCollations": false,
"serverRSAPublicKeyFile": "",
"allowPublicKeyRetrieval": false,
"dontCheckOnDuplicateKeyUpdateInSQL": false,
"readOnlyPropagatesToServer": true,
"enabledSSLCipherSuites": "",
"enabledTLSProtocols": "",
"enableEscapeProcessing": true
}
EDIT
Here are some screenshots to help you understand what I am seeing:
When I navigate to a record via the database table view (? in place of emoji):
When I execute a query to select the same record and view it in the console (the emoji is displayed as an emoji):
It's not possible in DataGrip yet, but might be solved after implementing this feature: https://youtrack.jetbrains.com/issue/DBE-2606

highchart activity gauge chart using json data from a file

I am new to using highcharts.js. I want to create an activity gauge chart using data from a json file or url. I have understood how they draw the chart but failed to understand the data format used in json to display the chart.
Here is my code
var options = {
chart: {
type: 'solidgauge',
marginTop: 50
},
title: {
text: 'Activity',
style: {
fontSize: '24px'
}
},
tooltip: {
borderWidth: 0,
backgroundColor: 'none',
shadow: false,
style: {
fontSize: '16px'
},
pointFormat: '{series.name}<br><span style="font-size:2em; color: {point.color}; font-weight: bold">{point.y}%</span>',
positioner: function (labelWidth, labelHeight) {
return {
x: 200 - labelWidth / 2,
y: 180
};
}
},
pane: {
startAngle: 0,
endAngle: 360,
background: [{ // Track for Move
outerRadius: '112%',
innerRadius: '88%',
backgroundColor: Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0.3).get(),
borderWidth: 0
}, { // Track for Exercise
outerRadius: '87%',
innerRadius: '63%',
backgroundColor: Highcharts.Color(Highcharts.getOptions().colors[1]).setOpacity(0.3).get(),
borderWidth: 0
}, { // Track for Stand
outerRadius: '62%',
innerRadius: '38%',
backgroundColor: Highcharts.Color(Highcharts.getOptions().colors[2]).setOpacity(0.3).get(),
borderWidth: 0
}]
},
yAxis: {
min: 0,
max: 100,
lineWidth: 0,
tickPositions: []
},
plotOptions: {
solidgauge: {
borderWidth: '34px',
dataLabels: {
enabled: false
},
linecap: 'round',
stickyTracking: false
}
},
series: []
};
var gauge1;
$.getJSON('bryan.json', function(json){
console.log(json)
options.chart.renderTo = 'container';
options.series.data = json
gauge1 = new Highcharts.Chart(options);
});
/**
* In the chart load callback, add icons on top of the circular shapes
*/
function callback()
{
// Move icon
this.renderer.path(['M', -8, 0, 'L', 8, 0, 'M', 0, -8, 'L', 8, 0, 0, 8])
.attr({
'stroke': '#ffffff',
'stroke-linecap': 'round',
'stroke-linejoin': 'round',
'stroke-width': 2,
'zIndex': 10
})
.translate(190, 26)
.add(this.series[2].group);
// Exercise icon
this.renderer.path(['M', -8, 0, 'L', 8, 0, 'M', 0, -8, 'L', 8, 0, 0, 8, 'M', 8, -8, 'L', 16, 0, 8, 8])
.attr({
'stroke': '#ffffff',
'stroke-linecap': 'round',
'stroke-linejoin': 'round',
'stroke-width': 2,
'zIndex': 10
})
.translate(190, 61)
.add(this.series[2].group);
// Stand icon
this.renderer.path(['M', 0, 8, 'L', 0, -8, 'M', -8, 0, 'L', 0, -8, 8, 0])
.attr({
'stroke': '#ffffff',
'stroke-linecap': 'round',
'stroke-linejoin': 'round',
'stroke-width': 2,
'zIndex': 10
})
.translate(190, 96)
.add(this.series[2].group);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="container" style="width: 400px; height: 400px; margin: 0 auto">
</div>
And here is my json data which i thout might be rendered but it didnot.
data.json
First of all, instead of options.series.data = json, you need to create the first series and then populate its data array with your data. Also, set in each point different radius and innerRadius properties. Take a look at the example below.
API Reference:
http://api.highcharts.com/highcharts/series.solidgauge.data.radius
http://api.highcharts.com/highcharts/series.solidgauge.data.innerRadius
Example:
http://jsfiddle.net/x3cne1ng/

sublime text font size on size bar does not change

Using sublime text 3, I have installed the material theme.
But I notice that the sidebar font size is too small.
Following the doc and searching on stack, I have change the default setting in the file named Material-Theme-Darker.sublime-theme and the other one named Default.sublime-theme like this (the two are the same):
[
{"class": "tab_control", "attributes": ["selected", "file_medium_dark"],"tint_modifier": [255, 255, 255, 80]},
{
"class": "sidebar_label",
"color": [0, 0, 0],
"font.bold": false,
"shadow_color": [250, 250, 250], "shadow_offset": [0, 0],
"font.size": 16
},
]
But nothing change. Where am I wrong ?
This my default user setting Preferences.sublime-settings:
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"caret_extra_bottom": 6,
"caret_extra_top": 6,
"caret_style": "phase",
"color_scheme": "Packages/User/SublimeLinter/itg.dark (SL).tmTheme",
"default_encoding": "UTF-8",
"default_line_ending": "unix",
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"font-face": "Saab",
"font_options":
[
"gray_antialias",
"subpixel_antialias"
],
"font_size": 15.5,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
],
"indent_guide_options":
[
"draw_normal",
"draw_active"
],
"indent_subsequent_lines": true,
"line_padding_bottom": 1,
"line_padding_top": 1,
"match_brackets": true,
"match_brackets_angle": false,
"match_brackets_braces": true,
"match_brackets_content": true,
"match_brackets_square": true,
"match_selection": true,
"material_theme_bold_tab": true,
"material_theme_compact_sidebar": true,
"material_theme_panel_separator": true,
"material_theme_small_tab": false,
"material_theme_tabs_autowidth": true,
"material_theme_tabs_separator": true,
"material_theme_tree_headings": true,
"overlay_scroll_bars": "enabled",
"quick_panel_small": true,
"save_on_focus_lost": true,
"scroll_past_end": true,
"scroll_speed": 1.5,
"shift_tab_unindent": true,
"show_encoding": true,
"show_line_endings": true,
"spell_check": false,
"tab_size": 4,
"theme": "Material-Theme-Darker.sublime-theme",
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"word_wrap": true
}

Highchart speedometer take input from csv

I am trying to read the data from csv and display it as a input to Speedometer but I am unable to get the chart. Please tell me where i am going wrong.
My code is:
$(document).ready(function() {
var options = {
chart: {
type: 'gauge',
plotBackgroundColor: null,
plotBackgroundImage: null,
plotBorderWidth: 0,
plotShadow: false
},
title: {
text: 'Speedometer'
},
pane: {
startAngle: -150,
endAngle: 150,
background: [{
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#FFF'],
[1, '#333']
]
},
borderWidth: 0,
outerRadius: '109%'
}, {
backgroundColor: {
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
stops: [
[0, '#333'],
[1, '#FFF']
]
},
borderWidth: 1,
outerRadius: '107%'
}, {
// default background
}, {
backgroundColor: '#DDD',
borderWidth: 0,
outerRadius: '105%',
innerRadius: '103%'
}]
},
// the value axis
yAxis: {
min: 0,
max: 100,
minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',
tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
labels: {
step: 2,
rotation: 'auto'
},
title: {
text: 'km/h'
},
plotBands: [{
from: 0,
to: 120,
color: '#55BF3B' // green
}, {
from: 120,
to: 160,
color: '#DDDF0D' // yellow
}, {
from: 160,
to: 200,
color: '#DF5353' // red
}]
},
series: []
};
$.get('data.csv', function(data) {
var series = {
data: [],
name: 'Speed',
tooltip: {
valueSuffix: ' km/h'
}
};
series.data.push(parseFloat(data));
options.series.push(series);
alert("data "+options.series);
var chart = new Highcharts.Chart(options);
});
});
and the csv file is simple
data.csv has only one value 30.
or incase it is
t1,30
t2,40
t3,60
how do i display 3 corresponding speedometers with respective speed.
Your help is greatly appreciated.
Thanks in advance.
In your case data your data (from ajax) is a single string, but you need to split elements and then choose which should be parsed to integer (parseFloat).