I created a custom post type for creating different type of charts in wordpress. And created a list view column to preview the chart created in each post type. Everything working fine, but the preview chart is showing in original size. I need to get it in small size just to show preview.
Please have a look at SCREENSHOT HERE: http://s14.postimg.org/szyowvzqp/screenshot_33.png
How can I make the chart preview small in size?
I wrapped the chart with new to set height and width 100px. here is screenshot: http://s14.postimg.org/gcixkdktt/screenshot_35.png Unfortunately, this cut off the chart instead of getting the charts small as the canvas height & width are set. Here is result: http://s14.postimg.org/8iibyzd0x/screenshot_34.png
One way of doing this would be to add custom styles to wp admin. Either by putting them in the <head>
or by properly enqueuing them with (this is the preferred way I guess):
add_action( 'admin_enqueue_scripts', 'load_admin_styles' );
function load_admin_styles() {
wp_enqueue_style( 'admin_css_foo', get_template_directory_uri() . '/admin-style-foo.css' );
wp_enqueue_style( 'admin_css_bar', get_template_directory_uri() . '/admin-style-bar.css' );
}
You could then specify a max-height
for the column holding the chart, e.g.:
.chart {
max-height: 50px;
}