In Progress

Chart

4

Dear team,

I am using the ApexCharts library included in the Greenshift plugin for my custom HTML charts. I have encountered a persistent issue where the PNG images downloaded via the chart toolbar are very small and blurry across all devices.
Link test: https://timhoa.com/test

I have spent a lot of time trying to fix this, including using multiple AI tools (Gemini, ChatGPT, Claude) to try settings like scale, dimensions, and JavaScript resizing, but unfortunately, nothing has worked.

I would like to kindly ask for your help to resolve this once and for all. Could you please consider adjusting the plugin or providing a solution so that the exported PNG image has a minimum width of 1200px?

The current export size is too small to be useful for my users. I would be very grateful if you could provide a root-level fix or a hook to ensure high-quality rendering regardless of the screen size.

Thank you very much for your support!

dobimarketing@gmail.com

⏱

Replies

Responses

  1. we will add bigger static size in next update, but I am not sure if this will help. Also you can use

    {
      "chart": {
        "toolbar": {
          "show": true,
          "export": {
            "png": {
              "filename": "chart-export"
            },
            "svg": {
              "filename": "chart-export"
            }
          }
        }
      }
    }
  2. Dear Greenshift Team,

    Thank you for your incredibly quick support! As a long-time user who always trusts your technical expertise, I completely agree with your direction. Deeply hooking into the ApexCharts JavaScript logic to force a higher rendering scale is definitely the most professional and effective solution.

    I have exhausted every possible workaround on my end without success, so I am placing all my confidence in your upcoming update. A root-level fix to ensure high-quality, 1200px+ exports would be a lifesaver for my project.

    Looking forward to your expert solution. Best regards!

  3. Ok. Let me know if it will work after update or not

  4. Hi Greenshift Team,

    I have updated all plugins to the latest versions:

    Greenshift Query and Meta Addon: v5.9.6

    GreenShift Advanced Animation Addon: v3.7.7

    ….anymore(All are set to auto-update and I have verified them manually).

    However, the issue remains. The downloaded PNG is only 600×275 px, which is too small and blurry for my users. I need it to be at least 1200px wide for high-quality rendering.

    You can check it here: https://timhoa.com/test

    Below is the HTML code I am using:

    <div class="scent-chart-lazy-wrapper" style="width: 100%; overflow: hidden;">
    <div style="text-align: center; margin-bottom: 5px;">
    <div style="margin: 0; color: #333; font-weight: 600;">Đánh giá về mùi hương</div>
    <div style="margin: 4px 0 0; font-size: 0.9em; color: #777; font-style: italic;">
    (% người dùng khảo sát)
    </div>
    </div>
    <div id="scent-bar-lazy-load" style="width: 100%;"></div>
    </div>

    <script>
    (function() {
    const renderChart = () => {
    const chartElement = document.querySelector("#scent-bar-lazy-load");
    if (!chartElement || chartElement.querySelector('.apexcharts-canvas')) return;

    const siteFont = getComputedStyle(document.body).fontFamily;

    const options = {
    series: [{ name: 'Tỷ lệ đánh giá', data: [10, 20, 20, 30, 20] }],
    chart: {
    type: 'bar',
    height: 275,
    width: '100%',
    fontFamily: siteFont || 'inherit',
    toolbar: {
    show: true,
    offsetY: -5,
    tools: { download: true },
    // Phần quan trọng nhất để sửa lỗi mờ/nhỏ ở đây:
    export: {
    png: {
    dimensions: {
    width: 1200, // Ép chiều rộng ảnh xuất ra là 1200px
    height: undefined // Để tự động theo tỷ lệ
    }
    }
    }
    },
    animations: { enabled: true, easing: 'easeinout', speed: 800 }
    },
    tooltip: { enabled: false },
    states: { hover: { filter: { type: 'none' } }, active: { filter: { type: 'none' } } },
    plotOptions: {
    bar: { horizontal: true, borderRadius: 2, barHeight: '65%', distributed: true, dataLabels: { position: 'top' } }
    },
    colors: ['#51CF66', '#8CE99A', '#FFE066', '#FF9E9E', '#FF6B6B'],
    fill: {
    type: 'gradient',
    gradient: { shade: 'light', type: "horizontal", shadeIntensity: 0.1, gradientToColors: ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'], inverseColors: false, opacityFrom: 1, opacityTo: 0.3, stops: [0, 100] }
    },
    dataLabels: { enabled: true, textAnchor: 'end', formatter: val => val + "%", style: { fontSize: '13px', fontWeight: 600, colors: ['#444'], fontFamily: siteFont }, offsetX: -8 },
    legend: { show: false },
    xaxis: { categories: ["Rất thích", "Thích", "Bình thường", "Không thích", "Rất không thích"], labels: { show: false }, axisBorder: { show: false }, axisTicks: { show: false } },
    yaxis: { labels: { style: { fontSize: '13px', fontWeight: 500, colors: ['#333'], fontFamily: siteFont } } },
    grid: {
    show: false,
    padding: { top: -15, bottom: -15, right: 10 }
    },
    stroke: { show: true, width: 1, colors: ['rgba(0,0,0,0.05)'] }
    };

    const chart = new ApexCharts(chartElement, options);
    chart.render();
    };

    const loadApexChartsAndRender = () => {
    if (typeof ApexCharts !== 'undefined') { renderChart(); return; }

    const scriptSrc = '/wp-content/plugins/greenshift-animation-and-page-builder-blocks/libs/apexchart/apexchart.min.js';
    let existingScript = document.querySelector(`script[src="${scriptSrc}"]`);

    if (existingScript) {
    if (existingScript.dataset.loaded) { renderChart(); }
    else { existingScript.addEventListener('load', renderChart); }
    } else {
    const script = document.createElement('script');
    script.src = scriptSrc;
    script.onload = () => {
    script.dataset.loaded = true;
    renderChart();
    };
    document.head.appendChild(script);
    }
    };

    const observer = new IntersectionObserver((entries, observer) => {
    entries.forEach(entry => {
    if (entry.isIntersecting) {
    loadApexChartsAndRender();
    observer.unobserve(entry.target);
    }
    });
    }, { threshold: 0.2 });

    const target = document.querySelector('.scent-chart-lazy-wrapper');
    if (target) observer.observe(target);
    })();
    </script>

    Please take another look at the root-level rendering scale. Thank you!

Post a Reply