Display First and Last name in Charts
-
Hello,
I’m using a registration form where users also have to add there first and lastname.
Instead of the username I want to display the first and lastname of a user everywhere. I’m almost done changing it everywhere but I cant manage to change it in the charts.
I’ve done it like this:
// chart 2: scoreverloop if ( count( $users ) >= 1 ) { $output .= '<br class="clear" />'; $raw_data = $chart_data->score_per_match_line_chart_data( $users, $ranking ); if ( count( $raw_data ) > 0 ) { $chart = new Football_Pool_Chart( 'chart2', 'line', 720, 500 ); $chart->data = $chart_data->score_per_match_line_series( $raw_data ); $chart->title = __( 'points scored', FOOTBALLPOOL_TEXT_DOMAIN ); $txt = __( 'points', FOOTBALLPOOL_TEXT_DOMAIN ); $voornaam = get_user_meta($user, "voornaam", true); $achternaam = get_user_meta($user, "achternaam", true); $chart->options[] = "tooltip: { shared: true, crosshairs: true, formatter: function() { s = '<b>' + categories[this.x] + '</b><br/>'; jQuery.each( this.points, function( i, point ) { s += '<b style=\"color:' + point.series.color + '\">' + point.series.name + ' {$voornaam}{$achternaam}</b>: ' + point.y + ' {$txt}<br>'; } ); return s; } }"; $chart->JS_options[] = 'options.xAxis.labels.enabled = false'; $chart->JS_options[] = 'options.yAxis.min = -1'; $chart->JS_options[] = 'options.yAxis.showFirstLabel = false'; $output .= $chart->draw(); }
It is showing the first and last name of 1 single user but not of all the users. Somehow he is just getting one single first and lastname.
Is there a way I can make this work?
Thanks in advance:)
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Display First and Last name in Charts’ is closed to new replies.